Skip to content

Commit 6672eff

Browse files
committed
Temp.
1 parent 7292d4f commit 6672eff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymodbus/pdu/register_message.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from __future__ import annotations
33

44
import struct
5+
from collections.abc import Sequence
56
from typing import cast
67

78
from pymodbus.datastore import ModbusDeviceContext
@@ -282,7 +283,7 @@ async def update_datastore(self, context: ModbusDeviceContext) -> ModbusPDU:
282283
if not 0x0000 <= self.or_mask <= 0xFFFF:
283284
return ExceptionResponse(self.function_code, ExceptionResponse.ILLEGAL_VALUE)
284285
values = await context.async_getValues(self.function_code, self.address, 1)
285-
values = (values[0] & self.and_mask) | (self.or_mask & ~self.and_mask)
286+
values = (cast(Sequence[int | bool], values)[0] & self.and_mask) | (self.or_mask & ~self.and_mask)
286287
rc = await context.async_setValues(
287288
self.function_code, self.address, cast(list[int], [values])
288289
)

0 commit comments

Comments
 (0)