cibernox / homeassistant-poolstation

HomeAssistant custom component for integrating the Poolstation platform.
MIT License
9 stars 4 forks source link

Setting the value for target ORP, PH and Production result in an error #9

Closed RienduPre closed 1 year ago

RienduPre commented 1 year ago

Hi,

When I try to set the target for ORP, PH or Production it results in an error (see below) and the setting doesn't change.

`Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/poolstation/number.py:98 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 14:39:34 (3 occurrences) Last logged: 14:53:53

[281472350569296] Pool.set_target_attribute() takes 3 positional arguments but 4 were given [281472351033296] Pool.set_target_attribute() takes 3 positional arguments but 4 were given [281472327457040] Pool.set_target_attribute() takes 3 positional arguments but 4 were given Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/number/init.py", line 106, in async_set_value await entity.async_set_native_value(native_value) File "/usr/src/homeassistant/homeassistant/components/number/init.py", line 437, in async_set_native_value await self.hass.async_add_executor_job(self.set_native_value, value) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/number/init.py", line 433, in set_native_value raise NotImplementedError() NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1910, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1950, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 811, in entity_service_call future.result() # pop exception if have ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1034, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 851, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/number/init.py", line 108, in async_set_value await entity.async_set_value(value) File "/config/custom_components/poolstation/number.py", line 98, in async_set_value self._attr_value = await self._pool.set_target_orp(value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pypoolstation/init.py", line 155, in set_target_orp return self.set_target_attribute(self, "target_orp", value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Pool.set_target_attribute() takes 3 positional arguments but 4 were given `

cibernox commented 1 year ago

Interesting. I hadn't adjusted the target PH in a while and it is failing now. It did work, there must have been a breaking change in HA that I didn't notice. Since I'll be making changes to the integration today I'll make sure to check this one.

cibernox commented 1 year ago

I believe this should be fixed now. I will continue making improvements but I started by addressing this bug.

RienduPre commented 1 year ago

Thanks! Ckecked it and it is solved:-)