From 5b9b8d8e52bbdc76852cfbe074eabca11eb4d4cf Mon Sep 17 00:00:00 2001 From: Richard van den Berg Date: Sun, 28 Jan 2024 01:39:08 +0100 Subject: [PATCH] Log slave error codes --- lib/TWCManager/TWCSlave.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/TWCManager/TWCSlave.py b/lib/TWCManager/TWCSlave.py index 307453c4..8189f484 100644 --- a/lib/TWCManager/TWCSlave.py +++ b/lib/TWCManager/TWCSlave.py @@ -366,10 +366,10 @@ def send_master_heartbeat(self): # Manual says this code means 'The networked Wall # Connectors have different maximum current # capabilities.' - # 0000 1000 = No effect - # 0001 0000 = No effect - # 0010 0000 = No effect - # 0100 0000 = No effect + # 0000 1000 = No effect + # 0001 0000 = No effect + # 0010 0000 = No effect + # 0100 0000 = No effect # 1000 0000 = No effect # When two bits are set, the lowest bit (rightmost bit) seems to # take precedence (ie 111 results in 3 blinks, 110 results in 5 @@ -577,6 +577,16 @@ def receive_slave_heartbeat(self, heartbeatData): self.reportedAmpsActual = ((heartbeatData[3] << 8) + heartbeatData[4]) / 100 self.reportedState = heartbeatData[0] + if self.reportedState == 0x02: + logger.info( + "WARNING: slave TWC %02X%02X is sending error with status data: %s" + % ( + self.TWCID[0], + self.TWCID[1], + self.master.hex_str(heartbeatData), + ) + ) + if self.reportedAmpsActual != self.reportedAmpsLast: self.reportedAmpsLast = self.reportedAmpsActual for module in self.master.getModulesByType("Status"):