Has anyone had a problem displaying whole numbers in the state displayType in detailView? It does not seem to matter if the field in the capability is a string or integer. Oddly, results display as expected in History.
For example,
“bosco” displays as bosco
“10.0” displays as 10.0
“10” displays as 12:00 AM
With some trial and error, whole numbers 13-31 display as Invalid Date, until I refresh, at which point they display as the correct number. Whole numbers 0-12 and >31 (up to around 200000) display 12:00 AM. Obviously, it seems to be expecting a date, although I have no idea why. Adding a decimal seems to force the number to display as expected.
Here’s my capability:
{
"id": "titlewonder37618.saltStatus",
"version": 1,
"status": "proposed",
"name": "Salt Status",
"attributes": {
"saltStatus": {
"schema": {
"type": "object",
"properties": {
"value": {
"type": "integer"
},
"unit": {
"type": "string",
"default": "ppm"
}
},
"additionalProperties": false,
"required": [
"value"
]
},
"setter": "setSaltStatus",
"enumCommands": []
}
},
"commands": {
"setSaltStatus": {
"name": "setSaltStatus",
"arguments": [
{
"name": "value",
"optional": false,
"schema": {
"type": "integer"
}
}
]
}
}
}
And the associated presentation:
>{
"dashboard": {
"states": [
{
"label": "Salt Status: {{saltStatus.value}} ppm"
}
],
"actions": [],
"basicPlus": []
},
"detailView": [
{
"label": "Salt Status",
"displayType": "state",
"state": {
label: "{{saltStatus.value}}",
unit: "saltStatus.unit"
}
}
],
"id": "titlewonder37618.saltStatus",
"version": 1
}