Closed alfista2600 closed 9 months ago
what happened to this construct? HABApp.openhab.interface.send_command
The module was renamed because it was never part of the official api.
OpenhabItem.get_item('my_name').send_command('bla')
and how do I detect the type of a item, in lieu of this? HABApp.openhab.interface.get_item(device, metadata=None, all_metadata=False).type
Why would you use this instead of
item = OpenhabItem.get_item('my_name')
is_switch = isinstance(item, SwitchItem)
Why would you use this instead of
Most likely because I am a lousy coder! Just do what I can to get things to work and move on. Will use your example as I rewrite code.
Are you aware of the difference between the two solutions? My example uses the local item cache of HABApp and your original solution queried openHAB every time for the item definition.
I am admittedly behind the documentation curve, too busy to test, and not as smart as those supporting development, but:
what happened to this construct? HABApp.openhab.interface.send_command
and how do I detect the type of a item, in lieu of this? HABApp.openhab.interface.get_item(device, metadata=None, all_metadata=False).type