File: PyViCareFloorHeating.py

package info (click to toggle)
pyvicare 2.56.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,580 kB
  • sloc: python: 4,977; sh: 5; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 1,204 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from PyViCare.PyViCareDevice import ZigbeeDevice, Device
from PyViCare.PyViCareUtils import handleAPICommandErrors, handleNotSupported


class FloorHeating(ZigbeeDevice):

    @handleNotSupported
    def getSupplyTemperature(self) -> float:
        return float(self.getProperty("fht.sensors.temperature.supply")["properties"]["value"]["value"])

    @handleNotSupported
    def getActiveMode(self) -> str:
        return str(self.getProperty("fht.operating.modes.active")["properties"]["value"]["value"])


class FloorHeatingChannel(Device):

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

    @handleNotSupported
    def getName(self) -> str:
        return str(self.getProperty("device.name")["properties"]["name"]["value"])

    @handleAPICommandErrors
    def setName(self, name: str) -> None:
        self.setProperty("device.name", "setName", {'name': name})

    @handleNotSupported
    def getValveState(self) -> str:
        return str(self.getProperty("fht.valve.state")["properties"]["status"]["value"])

    @handleNotSupported
    def isValveOpen(self) -> bool:
        return bool(self.getValveState() != "closed")