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
CFenner authored Dec 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b2addf6 commit f1a1512
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
@@ -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"]
3 changes: 3 additions & 0 deletions tests/test_zigbee_zk03839.py
Original file line number Diff line number Diff line change
@@ -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)

3 changes: 3 additions & 0 deletions tests/test_zigbee_zk03840.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit f1a1512

Please sign in to comment.