File: PyViCareRoomSensor.py

package info (click to toggle)
pyvicare 2.55.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,560 kB
  • sloc: python: 4,867; sh: 5; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 567 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from PyViCare.PyViCareDevice import ZigbeeBatteryDevice
from PyViCare.PyViCareUtils import handleNotSupported


class RoomSensor(ZigbeeBatteryDevice):

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

    @handleNotSupported
    def getTemperature(self):
        return self.getProperty("device.sensors.temperature")["properties"]["value"]["value"]

    @handleNotSupported
    def getHumidity(self):
        return self.getProperty("device.sensors.humidity")["properties"]["value"]["value"]