benleb / sureha

SureHA 🐾 monitor & control your Sure Petcare devices via Home Assistant
Apache License 2.0
20 stars 12 forks source link

v2.x fails to call service #17

Closed xbmcnut closed 3 years ago

xbmcnut commented 3 years ago

Just upgraded to v2.0 and then v2.1 and now get the following error (on both versions):

2021-09-07 15:10:57 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Invalid data for call_service at pos 1: value must be one of [] for dictionary value @ data['flap_id']
2021-09-07 15:10:57 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140400169379200] Error handling message: value must be one of [] for dictionary value @ data['flap_id']. Got None

Here is the service I tried which is affecting my switches used to lock and unlock the door. Rolling back to the dev version (d434161) fixes it.

service: sureha.set_lock_state
data:
  flap_id: 7xx35xx
  lock_state: unlocked

Going to try switching now to the main HA version to see what happens.

xbmcnut commented 3 years ago

Tested HA Sure Petcare via YAML integration and that is not working either. Fails to create the door sensor. Staying on d434161 for now as that is fully working. Lucky I took backups!!

benleb commented 3 years ago

I will take a look, sorry 👍

Btw., don't worry about getting old versions, they stay in my/the home assistant repo and/or also on pypi (surepy lib) 😊

benleb commented 3 years ago

sorry, I broke the condition of allowed values... Can you confirm it works with the current dev branch?

xbmcnut commented 3 years ago

Will do. I'll try 2.1 later today and report back. This one?

image

benleb commented 3 years ago

refresh and update to v0.2.2 👍

xbmcnut commented 3 years ago

See it now, thank you. Are you aligning the dev version with the HA version?

benleb commented 3 years ago

I would like to but... it's complicated ;) Home assistant won't accept a switch from the old, broken surepetcare to the sureha version in one big PR and don't have to the and also the will to split it to 5-15 smaller PRs. Splitting it up is a lot of work as every single PR done must basically be a working version of the integration which means touching the same code parts all over the integration, again and again, to make everything work with the current of XX PRs... I am in contact with @Danielhiversen and I think I also reach out to @MartinHjelmare to find a solution for this mess (which is initially my fault, not HAs!)

xbmcnut commented 3 years ago

Thanks for the feedback. Seems like a big job! I can confirm that v2.3 is working as expected with the sureha.set_lock_state fully functional again and the door sensor showing the correct state. Feel free to close this bug report.

benleb commented 2 years ago

Btw., @Danielhiversen did a lot of work in the last few days on the integration, implementing a lot of stuff from sureha, I added the felaqua today... 👍