load available programs from api and add service calls for appliance programs #49
load available programs from api and add service calls for appliance programs #49cycl0psg wants to merge 4 commits into
Conversation
- add appliance specific sensors and binary_sensors - include sensors and binary_sensors device_class and unit implementation - usage of homeassistant constants for device classes and sensor units
|
Thanks a lot for the PR! Can you please provide some description so I don't have to dig everything from the source code? Note that the PR in Home Assistant is currently under review and it's probably quite complicated to include such extensive changes at this point in the review process (especially since some requested changes over there are not yet done). I'd be very grateful if you could help me getting the PR merged. Edit: link to the PR: home-assistant/core#29214 |
resync repo
Create service calls for available programs with specific parameters fetched from api. Requires this PR to be merged in the homeconnect api DavidMStraub/homeconnect#4 The parameter list for each call is fetched from the api but, since the service descriptions are written in the service.yaml file, services not detailed in this file will have no call parameters specifications detailed unless someone add them. I've added the one for the appliance I own
|
Create service calls for available programs with specific parameters fetched from api. The parameter list for each call is fetched from the api but, since the service descriptions are written in the service.yaml file, services not detailed in this file will have no call parameters specifications detailed unless someone add them. |
|
I've also rebased the PR to your last changes to avoid conflicts. I'll keep it updated until it can be merged |
|
@cycl0psg, I need to apologize for not having reviewed your PR yet. In the last couple of weeks I tried to fix the outstanding bug DavidMStraub/homeconnect#3, to no avail so far, and didn't have the energy to do anything in addition. I hope I can do it soon. |
|
Don't worry, I have no rush |
|
Hi, a couple of comments:
|
| device.entities += entity_list | ||
| entities += entity_list | ||
| if device.has_programs: | ||
| services = device.get_programs_services() |
There was a problem hiding this comment.
This line prevents me to have an HC integration up and running (I have a Bosch dishwasher).
Here is the detailed error:
2020-04-06 11:56:54 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up homeconnect platform for sensor
Traceback (most recent call last):
File "/home/ligio/workspace/home-assistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/home/ligio/.homeassistant/custom_components/homeconnect/sensor.py", line 41, in async_setup_entry
async_add_entities(await hass.async_add_executor_job(get_entities), True)
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/ligio/.homeassistant/custom_components/homeconnect/sensor.py", line 29, in get_entities
services = device.get_programs_services()
File "/home/ligio/.homeassistant/custom_components/homeconnect/api.py", line 229, in get_programs_services
options = self.appliance.get_program_options(p)
AttributeError: 'HomeConnectAppliance' object has no attribute 'get_program_options'
At the moment I don't remember the reason for this but I think it can be handled in another way
I only have an Oven which even when is off is probably always connected so I didn't notice that behavior. Anyway we can leave the hard-coded programs as a fallback in case the lookup don't succeed or try and create a cache of the discovered programs and use those. I'm not able to do anything for the time being because I'm quarantined away from home and I can't have access to development or appliance. I don't know for how long so I have to ask you to be patient and wait for some weeks until I can get back home. |
|
Just wondering if more work is going to be done on this PR, as I'd love to be able to make use of service calls to set delayed start time after remote start is enabled on my dishwasher. |
|
Sorry about that - the PR in Core, that was based on the version before this PR, took such a huge amount of time and required so many changes, that I did not have time or energy to give as much attention to this as it deserved. But I agree that service calls are an important feature. I would suggest to start from scratch and with only one feature at a time, in particular not mixing the available programs and service calls. @cycl0psg, would you be interested in that after waiting so long? |
|
No need to apologise - what you have done with this is amazing! I know what a time suck these things can be, and how hard it can be to make time for everything. |
Hi @DavidMStraub , There is very little left on my wish list:
|
|
Since I've started implenting service calls, I will close this now. |
Added handling of appliance specific sensors: