Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(trv): use device.name to determine device serial #469

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading