File tree Expand file tree Collapse file tree
custom_components/solax_modbus Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,9 +92,8 @@ async def async_press(self) -> None:
9292 data = res .get ('data' , None )
9393 action = res .get ('action' )
9494 if not action : _LOGGER .error (f"autorepeat value function for { self ._key } must return dict containing action" )
95- else : data = res
96- _LOGGER .info (f"writing { self ._platform_name } button register { self ._register } value { res } " )
97- if action == WRITE_MULTI_MODBUS :
98- await self ._hub .async_write_registers_multi (
99- unit = self ._modbus_addr , address = reg , payload = data
100- )
95+ _LOGGER .info (f"writing { self ._platform_name } button register { self ._register } value { res } " )
96+ if action == WRITE_MULTI_MODBUS :
97+ await self ._hub .async_write_registers_multi ( unit = self ._modbus_addr , address = reg , payload = data )
98+ else :
99+ await self ._hub .async_write_registers_multi ( unit = self ._modbus_addr , address = self ._register , payload = res )
You can’t perform that action at this time.
0 commit comments