I’m running OH3.1.0M5 and trying to create a widget with a button with some dynamic features but I seem to not be able to get the syntax right.
I have an item, a switch, called test_switch. When I enter this in the Code Tools - Widgets Expression Tester:
=(items["test_switch"].state)
The answer is: ON
Yet when I enter:
=(items["test_switch"].state === ON)
The answer is: false
I get the same for =(items.test_switch.state === ON)
I must be overlooking something silly.
Maybe related, when I try to update test_switch using a command from an oh-button I see this in the logging:
2021-06-16 11:25:42.704 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: toString
2021-06-16 11:25:42.704 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: t
2021-06-16 11:25:42.704 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: te
2021-06-16 11:25:42.704 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: tes
2021-06-16 11:25:42.704 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: test
2021-06-16 11:25:42.705 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: test_
2021-06-16 11:25:42.705 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: test_s
2021-06-16 11:25:42.705 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: test_sw
2021-06-16 11:25:42.705 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: test_swi
2021-06-16 11:25:42.705 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: test_swit
2021-06-16 11:25:42.705 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: test_switc