hawky358 / hass_ids_hyyp

Home Assistant integration for IDS Hyyp
GNU General Public License v3.0
12 stars 3 forks source link

Button entities for stay profiles missing #10

Closed spencerw67 closed 1 year ago

spencerw67 commented 1 year ago

I have two stay profiles on one partition but these don't appear as button entities in hass, i.e missing these: button.[sitename][partitionname][stay_profile_name]

spencerw67 commented 1 year ago

Implemented a temporary solution for this for me. The following error was encountered in the original code:

  File "/config/custom_components/ids_hyyp/button.py". line 33, in
    for trigger_id in coordinator.data[site_id]["triggers"]
KeyError: 'triggers'

I commented out the "async_add_entities" block that creates trigger buttons to resolve this. I think the code needs to cater for a site without any triggers as I don't have any. The json payload from the API shows this for triggers:

"triggers": [],

After doing this, the stay profile buttons were created successfully.

BTW - great work on getting this integration up and running!

hawky358 commented 1 year ago

Hello, Thanks for the logs. Makes debugging much easier.

I've released a fix on the beta branch. 1.3.1-b1 Works on my side, will you please check whether it resolves it for you?

spencerw67 commented 1 year ago

Thanks for the update. Stay profile buttons loaded with updated code.

hawky358 commented 1 year ago

Fixed with 1.3.1