Source code for nirahmq.enums

  1#  SPDX-License-Identifier: AGPL-3.0-or-later
  2#  Copyright (C) 2025  Dionisis Toulatos
  3
  4from enum import Enum, StrEnum
  5
  6
  7# Components
[docs] 8class Platform(StrEnum): 9 """The platform identifying each Home Assistant component supported by the MQTT integration.""" 10 11 ALARM_CONTROL_PANEL = "alarm_control_panel" 12 BINARY_SENSOR = 'binary_sensor' 13 BUTTON = 'button' 14 CAMERA = 'camera' 15 COVER = 'cover' 16 DEVICE_TRACKER = 'device_tracker' 17 DEVICE_TRIGGER = 'device_automation' 18 EVENT = 'event' 19 FAN = 'fan' 20 HUMIDIFIER = 'humidifier' 21 IMAGE = 'image' 22 CLIMATE = 'climate' 23 HVAC = 'climate' 24 LAWN_MOWER = 'lawn_mower' 25 LIGHT = 'light' 26 LOCK = 'lock' 27 NOTIFY = 'notify' 28 NUMBER = 'number' 29 SCENE = 'scene' 30 SELECT = 'select' 31 SENSOR = 'sensor' 32 SIREN = 'siren' 33 SWITCH = 'switch' 34 UPDATE = 'update' 35 TAG_SCANNER = 'tag_scanner' 36 TEXT = 'text' 37 VACUUM = 'vacuum' 38 VALVE = 'valve' 39 WATER_HEATER = 'water_heater'
40 41
[docs] 42class Category(Enum): 43 """The category of a component inside the device.""" 44 45 NORMAL = None 46 """The default category in Home Assistant when not specified. 47 48 A component of this category is actively providing useful information about the functionality of the device. 49 """ 50 CONFIG = 'config' 51 """The component configures the device in some way 52 53 A component of this category represents a configuration state in a device and not a measurement or action. 54 """ 55 DIAGNOSTIC = 'diagnostic' 56 """The component is only for diagnostic purposes. 57 58 A component of this category represents a state or action of the underlying system in the device. 59 """
60 61 62# Device Classes
[docs] 63class BinarySensorClass(StrEnum): 64 NONE = 'None' 65 BATTERY = 'battery' 66 BATTERY_CHARGING = 'battery_charging' 67 CARBON_MONOXIDE = 'carbon_monoxide' 68 COLD = 'cold' 69 CONNECTIVITY = 'connectivity' 70 DOOR = 'door' 71 GARAGE_DOOR = 'garage_door' 72 GAS = 'gas' 73 HEAT = 'heat' 74 LIGHT = 'light' 75 LOCK = 'lock' 76 MOISTURE = 'moisture' 77 MOTION = 'motion' 78 MOVING = 'moving' 79 OCCUPANCY = 'occupancy' 80 OPENING = 'opening' 81 PLUG = 'plug' 82 POWER = 'power' 83 PRESENCE = 'presence' 84 PROBLEM = 'problem' 85 RUNNING = 'running' 86 SAFETY = 'safety' 87 SMOKE = 'smoke' 88 SOUND = 'sound' 89 TAMPER = 'tamper' 90 UPDATE = 'update' 91 VIBRATION = 'vibration' 92 WINDOW = 'window'
93 94
[docs] 95class ButtonClass(Enum): 96 NONE = None 97 IDENTIFY = 'identify' 98 RESTART = 'restart' 99 UPDATE = 'update'
100 101
[docs] 102class CoverClass(Enum): 103 NONE = None 104 AWNING = 'awning' 105 BLIND = 'blind' 106 CURTAIN = 'curtain' 107 DAMPER = 'damper' 108 DOOR = 'door' 109 GARAGE = 'garage' 110 GATE = 'gate' 111 SHADE = 'shade' 112 SHUTTER = 'shutter' 113 WINDOW = 'window'
114 115
[docs] 116class EventClass(StrEnum): 117 NONE = 'None' 118 BUTTON = 'button' 119 DOORBELL = 'doorbell' 120 MOTION = 'motion'
121 122
[docs] 123class HumidifierClass(Enum): 124 NONE = None 125 HUMIDIFIER = 'humidifier' 126 DEHUMIDIFIER = 'dehumidifier'
127 128
[docs] 129class NumberClass(StrEnum): 130 NONE = 'None' 131 APPARENT_POWER = 'apparent_power' 132 AQI = 'aqi' 133 AREA = 'area' 134 ATMOSPHERIC_PRESSURE = 'atmospheric_pressure' 135 BATTERY = 'battery' 136 BLOOD_GLUCOSE_CONCENTRATION = 'blood_glucose_concentration' 137 CARBON_DIOXIDE = 'carbon_dioxide' 138 CARBON_MONOXIDE = 'carbon_monoxide' 139 CURRENT = 'current' 140 DATA_RATE = 'data_rate' 141 DATA_SIZE = 'data_size' 142 DISTANCE = 'distance' 143 DURATION = 'duration' 144 ENERGY = 'energy' 145 ENERGY_DISTANCE = 'energy_distance' 146 ENERGY_STORAGE = 'energy_storage' 147 FREQUENCY = 'frequency' 148 GAS = 'gas' 149 HUMIDITY = 'humidity' 150 ILLUMINANCE = 'illuminance' 151 IRRADIANCE = 'irradiance' 152 MOISTURE = 'moisture' 153 MONETARY = 'monetary' 154 NITROGEN_DIOXIDE = 'nitrogen_dioxide' 155 NITROGEN_MONOXIDE = 'nitrogen_monoxide' 156 NITROUS_OXIDE = 'nitrous_oxide' 157 OZONE = 'ozone' 158 PH = 'ph' 159 PM1 = 'pm1' 160 PM25 = 'pm25' 161 PM10 = 'pm10' 162 POWER_FACTOR = 'power_factor' 163 POWER = 'power' 164 PRECIPITATION = 'precipitation' 165 PRECIPITATION_INTENSITY = 'precipitation_intensity' 166 PRESSURE = 'pressure' 167 REACTIVE_POWER = 'reactive_power' 168 SIGNAL_STRENGTH = 'signal_strength' 169 SOUND_PRESSURE = 'sound_pressure' 170 SPEED = 'speed' 171 SULPHUR_DIOXIDE = 'sulphur_dioxide' 172 TEMPERATURE = 'temperature' 173 VOLATILE_ORGANIC_COMPOUNDS = 'volatile_organic_compounds' 174 VOLATILE_ORGANIC_COMPOUNDS_PARTS = 'volatile_organic_compounds_parts' 175 VOLTAGE = 'voltage' 176 VOLUME = 'volume' 177 VOLUME_FLOW_RATE = 'volume_flow_rate' 178 VOLUME_STORAGE = 'volume_storage' 179 WATER = 'water' 180 WEIGHT = 'weight' 181 WIND_DIRECTION = 'wind_direction' 182 WIND_SPEED = 'wind_speed'
183 184
[docs] 185class SensorClass(StrEnum): 186 NONE = 'None' 187 APPARENT_POWER = 'apparent_power' 188 AQI = 'aqi' 189 AREA = 'area' 190 ATMOSPHERIC_PRESSURE = 'atmospheric_pressure' 191 BATTERY = 'battery' 192 BLOOD_GLUCOSE_CONCENTRATION = 'blood_glucose_concentration' 193 CARBON_DIOXIDE = 'carbon_dioxide' 194 CARBON_MONOXIDE = 'carbon_monoxide' 195 CURRENT = 'current' 196 DATA_RATE = 'data_rate' 197 DATA_SIZE = 'data_size' 198 DATE = 'date' 199 DISTANCE = 'distance' 200 DURATION = 'duration' 201 ENERGY = 'energy' 202 ENERGY_DISTANCE = 'energy_distance' 203 ENERGY_STORAGE = 'energy_storage' 204 ENUM = 'enums' 205 FREQUENCY = 'frequency' 206 GAS = 'gas' 207 HUMIDITY = 'humidity' 208 ILLUMINANCE = 'illuminance' 209 IRRADIANCE = 'irradiance' 210 MOISTURE = 'moisture' 211 MONETARY = 'monetary' 212 NITROGEN_DIOXIDE = 'nitrous_oxide' 213 NITROGEN_MONOXIDE = 'nitrous_monoxide' 214 NITROUS_OXIDE = 'nitrous_oxide' 215 OZONE = 'ozone' 216 PH = 'ph' 217 PM1 = 'pm1' 218 PM25 = 'pm25' 219 PM10 = 'pm10' 220 POWER_FACTOR = 'power_factor' 221 POWER = 'power' 222 PRECIPITATION = 'precipitation' 223 PRECIPITATION_INTENSITY = 'precipitation_intensity' 224 PRESSURE = 'pressure' 225 REACTIVE_POWER = 'reactive_power' 226 SIGNAL_STRENGTH = 'signal_strength' 227 SOUND_PRESSURE = 'sound_pressure' 228 SPEED = 'speed' 229 SULPHUR_DIOXIDE = 'sulphur_dioxide' 230 TEMPERATURE = 'temperature' 231 TIMESTAMP = 'timestamp' 232 VOLATILE_ORGANIC_COMPOUNDS = 'volatile_organic_compounds' 233 VOLATILE_ORGANIC_COMPOUNDS_PARTS = 'volatile_organic_compounds_parts' 234 VOLTAGE = 'voltage' 235 VOLUME = 'volume' 236 VOLUME_FLOW_RATE = 'volume_flow_rate' 237 VOLUME_STORAGE = 'volume_storage' 238 WATER = 'water' 239 WEIGHT = 'weight' 240 WIND_DIRECTION = 'wind_direction' 241 WIND_SPEED = 'wind_speed'
242 243
[docs] 244class SensorStateClass(StrEnum): 245 MEASUREMENT = 'measurement' 246 MEASUREMENT_ANGLE = 'measurement_angle' 247 TOTAL = 'total' 248 TOTAL_INCREASING = 'total_increasing'
249 250
[docs] 251class SwitchClass(StrEnum): 252 NONE = 'None' 253 OUTLET = 'outlet' 254 SWITCH = 'switch'
255 256
[docs] 257class UpdateClass(StrEnum): 258 NONE = 'None' 259 FIRMWARE = 'firmware'
260 261
[docs] 262class ValveClass(StrEnum): 263 NONE = 'None' 264 WATER = 'water' 265 GAS = 'gas'
266 267 268# Misc
[docs] 269class TemperatureUnit(StrEnum): 270 CELSIUS = 'C' 271 FAHRENHEIT = 'F'
272 273
[docs] 274class Precision(Enum): 275 """The precision to use for this component.""" 276 277 HIGH = 0.1 278 """Values are multiple of ``0.1``""" 279 MEDIUM = 0.5 280 """Values are multiple of ``0.5``""" 281 LOW = 1.0 282 """Values are multiple of ``1``"""
283 284 285# Enums
[docs] 286class AlarmControlPanelCode(StrEnum): 287 NUMERIC = 'REMOTE_CODE' 288 TEXTUAL = 'REMOTE_CODE_TEXT'
289 290
[docs] 291class AlarmControlPanelFeature(StrEnum): 292 HOME = 'arm_home' 293 AWAY = 'arm_away' 294 NIGHT = 'arm_night' 295 VACATION = 'arm_vacation' 296 BYPASS = 'arm_custom_bypass' 297 TRIGGER = 'trigger'
298 299
[docs] 300class AlarmControlPanelState(StrEnum): 301 ARMED_AWAY = 'armed_away' 302 ARMED_BYPASS = 'armed_custom_bypass' 303 ARMED_HOME = 'armed_home' 304 ARMED_NIGHT = 'armed_night' 305 ARMED_VACATION = 'armed_vacation' 306 ARMING = 'arming' 307 DISARMED = 'disarmed' 308 DISARMING = 'disarming' 309 PENDING = 'pending' 310 TRIGGERED = 'triggered'
311 312
[docs] 313class ImageEncoding(StrEnum): 314 BINARY = 'bin' 315 BASE64 = 'b64'
316 317
[docs] 318class CoverState(StrEnum): 319 OPEN = 'open' 320 OPENING = 'opening' 321 CLOSED = 'closed' 322 CLOSING = 'closing' 323 STOPPED = 'stopped'
324 325
[docs] 326class DeviceTrackerSource(StrEnum): 327 GPS = 'gps' 328 ROUTER = 'router' 329 BT = 'bluetooth' 330 BLE = 'bluetooth_le'
331 332
[docs] 333class DeviceTriggerType(StrEnum): 334 BUTTON_SHORT_PRESS = 'button_short_press' 335 BUTTON_SHORT_RELEASE = 'button_short_release' 336 BUTTON_LONG_PRESS = 'button_long_press' 337 BUTTON_LONG_RELEASE = 'button_long_release' 338 BUTTON_DOUBLE_PRESS = 'button_double_press' 339 BUTTON_TRIPLE_PRESS = 'button_triple_press' 340 BUTTON_QUADRUPLE_PRESS = 'button_quadruple_press' 341 BUTTON_QUINTUPLE_PRESS = 'button_quintuple_press'
342 343
[docs] 344class DeviceTriggerSubtype(StrEnum): 345 TURN_ON = 'turn_on' 346 TURN_OFF = 'turn_off' 347 BUTTON_1 = 'button_1' 348 BUTTON_2 = 'button_2' 349 BUTTON_3 = 'button_3' 350 BUTTON_4 = 'button_4' 351 BUTTON_5 = 'button_5' 352 BUTTON_6 = 'button_6'
353 354
[docs] 355class HumidifierMode(StrEnum): 356 NORMAL = 'normal' 357 ECO = 'eco' 358 AWAY = 'away' 359 BOOST = 'boost' 360 COMFORT = 'comfort' 361 HOME = 'home' 362 SLEEP = 'sleep' 363 AUTO = 'auto' 364 BABY = 'baby'
365 366
[docs] 367class HumidifierAction(StrEnum): 368 OFF = 'off' 369 HUMIDIFYING = 'humidifying' 370 DRYING = 'drying' 371 IDLE = 'idle'
372 373
[docs] 374class HVACAction(StrEnum): 375 OFF = 'off' 376 HEATING = 'heating' 377 COOLING = 'cooling' 378 DRYING = 'drying' 379 IDLE = 'idle' 380 FAN = 'fan'
381 382
[docs] 383class HVACFanMode(StrEnum): 384 AUTO = 'auto' 385 LOW = 'low' 386 MEDIUM = 'medium' 387 HIGH = 'high'
388 389
[docs] 390class HVACMode(StrEnum): 391 AUTO = 'auto' 392 OFF = 'off' 393 COOL = 'cool' 394 HEAT = 'heat' 395 DRY = 'dry' 396 FAN_ONLY = 'fan_only'
397 398
[docs] 399class HVACPresetMode(StrEnum): 400 ECO = 'eco' 401 AWAY = 'away' 402 BOOST = 'boost' 403 COMFORT = 'comfort' 404 HOME = 'home' 405 SLEEP = 'sleep' 406 ACTIVITY = 'activity'
407 408
[docs] 409class LawnMowerState(StrEnum): 410 MOWING = 'mowing' 411 PAUSED = 'paused' 412 DOCKED = 'docked' 413 ERROR = 'error'
414 415
[docs] 416class LightColorMode(StrEnum): 417 ONOFF = 'onoff' 418 BRIGHTNESS = 'brightness' 419 COLOR_TEMP = 'color_temp' 420 HS = 'hs' 421 XY = 'xy' 422 RGB = 'rgb' 423 RGBW = 'rgbw' 424 RGBWW = 'rgbww' 425 WHITE = 'white'
426 427
[docs] 428class LockState(StrEnum): 429 JAMMED = 'jammed' 430 LOCKED = 'locked' 431 LOCKING = 'locking' 432 UNLOCKED = 'unlocked' 433 UNLOCKING = 'unlocking'
434 435
[docs] 436class NumberMode(StrEnum): 437 AUTO = 'auto' 438 BOX = 'box' 439 SLIDER = 'slider'
440 441
[docs] 442class TextMode(StrEnum): 443 TEXT = 'text' 444 PASSWORD = 'password'
445 446
[docs] 447class VacuumFeature(StrEnum): 448 START = 'start' 449 STOP = 'stop' 450 PAUSE = 'pause' 451 RETURN_HOME = 'return_home' 452 BATTERY = 'battery' 453 STATUS = 'status' 454 LOCATE = 'locate' 455 CLEAN_SPOT = 'clean_spot' 456 FAN_SPEED = 'fan_speed' 457 SEND_COMMAND = 'send_command'
458 459
[docs] 460class VacuumState(StrEnum): 461 CLEANING = 'cleaning' 462 DOCKED = 'docked' 463 PAUSED = 'paused' 464 IDLE = 'idle' 465 RETURNING = 'returning' 466 ERROR = 'error'
467 468
[docs] 469class VacuumFanSpeed(StrEnum): 470 MIN = 'min' 471 MEDIUM = 'medium' 472 HIGH = 'high' 473 MAX = 'max'
474 475
[docs] 476class ValveState(StrEnum): 477 OPEN = 'open' 478 OPENING = 'opening' 479 CLOSED = 'closed' 480 CLOSING = 'closing'
481 482
[docs] 483class WaterHeaterMode(StrEnum): 484 OFF = 'off' 485 ECO = 'eco' 486 ELECTRIC = 'electric' 487 GAS = 'gas' 488 HEAT_PUMP = 'heat_pump' 489 HIGH_DEMAND = 'high_demand' 490 PERFORMANCE = 'performance'