Skip to content

Commit

Permalink
fix(trv): use device.name to determine device serial (#469)
Browse files Browse the repository at this point in the history
add getSerial for TRV
  • Loading branch information
CFenner authored Dec 19, 2024
1 parent b2addf6 commit f1a1512
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PyViCare/PyViCareRadiatorActuator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

class RadiatorActuator(Device):

@handleNotSupported
def getSerial(self):
return self.service.getProperty("device.name")["deviceId"]

@handleNotSupported
def getTemperature(self):
return self.service.getProperty("device.sensors.temperature")["properties"]["value"]["value"]
Expand Down
3 changes: 3 additions & 0 deletions tests/test_zigbee_zk03839.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ def setUp(self):
self.service = ViCareServiceMock('response/zigbee_zk03839.json')
self.device = RoomSensor(self.service)

def test_getSerial(self):
self.assertEqual(self.device.getSerial(), "zigbee-2c1165fffe977770")

def test_isDomesticHotWaterDevice(self):
self.assertEqual(self.device.isDomesticHotWaterDevice(), False)

Expand Down
3 changes: 3 additions & 0 deletions tests/test_zigbee_zk03840.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ def setUp(self):
self.service = ViCareServiceMock('response/zigbee_zk03840_trv.json')
self.device = RadiatorActuator(self.service)

def test_getSerial(self):
self.assertEqual(self.device.getSerial(), "zigbee-048727fffe196e03")

def test_isDomesticHotWaterDevice(self):
self.assertEqual(self.device.isDomesticHotWaterDevice(), False)

Expand Down

0 comments on commit f1a1512

Please sign in to comment.