Skip to content

Commit 28f3c45

Browse files
Update switch.py
1 parent d011f7e commit 28f3c45

File tree

1 file changed

+6
-3
lines changed
  • custom_components/solaredge_modbus_multi

1 file changed

+6
-3
lines changed

custom_components/solaredge_modbus_multi/switch.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,13 @@ def is_on(self) -> bool:
234234

235235
async def async_turn_on(self, **kwargs: Any) -> None:
236236
_LOGGER.debug(f"set {self.unique_id} to 0x1")
237-
payload = ModbusClientMixin.convert_to_registers(
238-
0x1, data_type=ModbusClientMixin.DATATYPE.INT32, word_order="little"
237+
238+
await self._platform.write_registers(
239+
address=61762,
240+
payload=ModbusClientMixin.convert_to_registers(
241+
0x1, data_type=ModbusClientMixin.DATATYPE.INT32, word_order="little"
242+
),
239243
)
240-
await self._platform.write_registers(address=61762, payload=payload)
241244
await self.async_update()
242245

243246
async def async_turn_off(self, **kwargs: Any) -> None:

0 commit comments

Comments
 (0)