spacemanspiff2007 / HABApp

Easy home automation with MQTT and/or openHAB
Apache License 2.0
54 stars 23 forks source link

New things that do not work: #417

Closed alfista2600 closed 9 months ago

alfista2600 commented 9 months ago

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

spacemanspiff2007 commented 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)
alfista2600 commented 9 months ago

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.

spacemanspiff2007 commented 9 months ago

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.