meter_pro.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. from enum import Enum, IntFlag
  2. class MeterProWeatherIcon(Enum):
  3. """Weather icons supported by the Meter Pro and Meter Pro CO2 displays."""
  4. NONE = 0
  5. SUNNY = 1
  6. CLOUDY = 2
  7. OVERCAST = 3
  8. LIGHT_RAIN = 4
  9. HEAVY_RAIN = 5
  10. LIGHT_SNOW = 6
  11. HEAVY_SNOW = 7
  12. class MeterProDisplayZone(Enum):
  13. """Configurable areas of the Meter Pro screen."""
  14. MIDDLE = 1
  15. BOTTOM = 2
  16. class MeterProZoneIcon(Enum):
  17. """Icon shown next to a display zone."""
  18. INDOOR = 1
  19. OUTDOOR = 2
  20. class MeterProDisplaySource(Enum):
  21. """Where a display zone takes its temperature and humidity from."""
  22. NONE = 0
  23. METER = 1
  24. METER_PLUS = 2
  25. INDOOR_OUTDOOR_METER = 3
  26. HUB = 4 # Hub 2 and Hub Mini Matter
  27. METER_PRO = 5 # this device when the MAC is empty, else another Meter Pro
  28. NETWORK = 6 # values written with the weather command
  29. WEATHER_STATION = 8
  30. HUB3 = 9
  31. class MeterProDateFormat(Enum):
  32. """Date layout on the screen."""
  33. MONTH_DAY = 0
  34. DAY_MONTH = 1
  35. class MeterProComfortStatus(Enum):
  36. """The device's current temperature and humidity comfort status."""
  37. COMFORTABLE = 0
  38. DRY = 1
  39. WET = 2
  40. UNAVAILABLE = 3
  41. class MeterProAlarmMode(Enum):
  42. """How the meter signals a local threshold alarm."""
  43. DISABLED = 0
  44. FLASH_ONLY = 1
  45. SOUND_AND_FLASH = 2
  46. class MeterProAlarmVolume(Enum):
  47. """Alarm buzzer volume."""
  48. OFF = 1
  49. LOW = 2
  50. MEDIUM = 3
  51. HIGH = 4
  52. class MeterProCO2AlarmMode(IntFlag):
  53. """CO2 alarm conditions and the protocol's custom-setting bit."""
  54. DISABLED = 0
  55. LOW = 1
  56. HIGH = 2
  57. IN_RANGE = 4
  58. CUSTOM = 8
  59. class MeterProCO2AlarmStatus(Enum):
  60. """Current CO2 alarm reported by the meter."""
  61. NONE = 0
  62. LOW = 1
  63. HIGH = 2
  64. IN_RANGE = 3
  65. class MeterProTemperatureHumidityAlarmMode(IntFlag):
  66. """Local alarm conditions for the temperature and humidity limits."""
  67. DISABLED = 0
  68. TEMPERATURE_LOW = 0x01
  69. TEMPERATURE_HIGH = 0x02
  70. TEMPERATURE_IN_RANGE = 0x04
  71. HUMIDITY_LOW = 0x10
  72. HUMIDITY_HIGH = 0x20
  73. HUMIDITY_IN_RANGE = 0x40
  74. class MeterProTemperatureHumidityAlarmStatus(Enum):
  75. """Current alarm state of the temperature or humidity measurement."""
  76. NONE = 0
  77. LOW = 1
  78. HIGH = 2
  79. IN_RANGE = 3