Closed OlliL closed 1 year ago
Did you check if it is still working with Home Assistant with those changes?
Unfortunally I have no working homeassistant setup, so I did not check it ~~- but I wonder why it shouldn't work as all it does is adding the possibility to specify --path multiple times - you can still specify it only one time if you like. So it is 100% backward compatible i'd say. But yes - the log messages changed a bit of course - does HA work with those log messages? If thats the case I can make it have the same log output as before with one path argument, and the changed log output only when --path was specified multiple times.~~
I must correct my previous message - the return value as well as the argument to raw_query
changed.
To make it compatible, custom_components/bosch/__init__.py
has to be adjusted:
old:
async def custom_get(self, path) -> str:
"""Fetch value from gateway."""
async with self._update_lock:
return await self.gateway.raw_query(path=path)
new:
async def custom_get(self, path) -> str:
"""Fetch value from gateway."""
async with self._update_lock:
result = await self.gateway.raw_query(path=[path])
return result[0] if result else None
I could also create a new raw_query_multiple method, use that in bosch_cli and turn back raw_query to what it was before. Another option could be to not touch the library at all and just call raw_query multiple times from inside bosch_cli.
Please tell me your opinion :smile:
I've just submitted #35 which implements the version of calling raw_query multiple times from inside bosch_cli instead of breaking the API. This might be the best solution imho :smile:
lets close this as #35 got merged with the same functionallity but w/o any API break
Add the possibility to specify --path multiple times.
I am interested in 11 different parameters of my CT200. Right now I have to execute 3 rawscans to retrieve all possible data (basically everything but not recordings which takes awfully long to retrieve) - but all I need are those 11 parameters - all the other read out parameters are discarded.
It would be much better if there would be a way only requesting the parameters I need.
With that change it can now be achived by specifying all the path of interest.
Thats why I enhanced the parameters to allow multiple specification of the path parameter. For example: