baterie pri sell neklesne pod 20% ale pri normalnim provozu muze jit az k 10%, mame tak rezervu a neohrozime si nahly propad procent battery packu
This commit is contained in:
@@ -233,6 +233,17 @@ class PersistentModbusClient:
|
||||
raw = await self.read_register(address, device_id)
|
||||
return raw - 65536 if raw > 32767 else raw
|
||||
|
||||
async def read_holding_registers(
|
||||
self, address: int, count: int, device_id: int = 1
|
||||
) -> list[int]:
|
||||
"""FC 0x03 – souvislé holding registry (ověřování po blocích)."""
|
||||
async with _gateway_exclusive(self.host, self.port):
|
||||
async with self._lock:
|
||||
await self._ensure_connected()
|
||||
return await self._read_holding_registers_locked(
|
||||
address, count, device_id
|
||||
)
|
||||
|
||||
async def write_register(self, address: int, value: int, device_id: int = 1) -> bool:
|
||||
async with _gateway_exclusive(self.host, self.port):
|
||||
async with self._lock:
|
||||
|
||||
Reference in New Issue
Block a user