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:
Dusan Vojacek
2026-04-03 21:51:34 +02:00
parent 182d5a37e1
commit af761f0ff7
14 changed files with 659 additions and 173 deletions

View File

@@ -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: