-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Overkiz State, Command, CommandParameter enums (#228)
* Add enums * Extend enum * Split enums over files * Fix tests * Fix tests (2) * Style fix * Move import to .enums * Fix tests * Fix typo * Fix typo * Fix typo * Fix widget style * Fix names
- Loading branch information
Showing
8 changed files
with
1,124 additions
and
788 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# flake8: noqa: F401, F403 | ||
|
||
from .command import * | ||
from .execution import * | ||
from .gateway import * | ||
from .general import * | ||
from .state import * | ||
from .ui import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
from enum import Enum, unique | ||
|
||
|
||
@unique | ||
class OverkizCommand(str, Enum): | ||
"""Device commands used by Overkiz.""" | ||
|
||
ALARM_OFF = "alarmOff" | ||
ALARM_ON = "alarmOn" | ||
ALARM_PARTIAL_1 = "alarmPartial1" | ||
ALARM_PARTIAL_2 = "alarmPartial2" | ||
ARM = "arm" | ||
ARM_PARTIAL_DAY = "armPartialDay" | ||
ARM_PARTIAL_NIGHT = "armPartialNight" | ||
CLOSE = "close" | ||
CLOSE_SLATS = "closeSlats" | ||
CYCLE = "cycle" | ||
DEPLOY = "deploy" | ||
DISARM = "disarm" | ||
DOWN = "down" | ||
GLOBAL_CONTROL = "globalControl" | ||
IDENTIFY = "identify" | ||
MEMORIZED_VOLUME = "memorizedVolume" | ||
MY = "my" | ||
OFF = "off" | ||
ON = "on" | ||
OPEN = "open" | ||
OPEN_SLATS = "openSlats" | ||
PARTIAL = "partial" | ||
RING_WITH_SINGLE_SIMPLE_SEQUENCE = "ringWithSingleSimpleSequence" | ||
SET_ABSENCE_MODE = "setAbsenceMode" | ||
SET_ALARM_STATUS = "setAlarmStatus" | ||
SET_ALL_MODE_TEMPERATURES = "setAllModeTemperatures" | ||
SET_BOOST_MODE = "setBoostMode" | ||
SET_COMFORT_TEMPERATURE = "setComfortTemperature" | ||
SET_CLOSURE = "setClosure" | ||
SET_CLOSURE_AND_LINEAR_SPEED = "setClosureAndLinearSpeed" | ||
SET_CONTROL_DHW = "setControlDHW" | ||
SET_CONTROL_DHW_SETTING_TEMPERATURE = "setControlDHWSettingTemperature" | ||
SET_CURRENT_OPERATING_MODE = "setCurrentOperatingMode" | ||
SET_DEPLOYMENT = "setDeployment" | ||
SET_DEROGATION = "setDerogation" | ||
SET_DHW_MODE = "setDHWMode" | ||
SET_ECO_TEMPERATURE = "setEcoTemperature" | ||
SET_EXPECTED_NUMBER_OF_SHOWER = "setExpectedNumberOfShower" | ||
SET_FORCE_HEATING = "setForceHeating" | ||
SET_INTENSITY = "setIntensity" | ||
SET_MEMORIZED_SIMPLE_VOLUME = "setMemorizedSimpleVolume" | ||
SET_MEMORIZED_1_POSITION = "setMemorized1Position" | ||
SET_ORIENTATION = "setOrientation" | ||
SET_PEDESTRIAN_POSITION = "setPedestrianPosition" | ||
SET_RGB = "setRGB" | ||
SET_SECURED_POSITION_TEMPERATURE = "setSecuredPositionTemperature" | ||
SET_TARGET_TEMPERATURE = "setTargetTemperature" | ||
STANDARD = "standard" | ||
STOP = "stop" | ||
STOP_IDENTIFY = "stopIdentify" | ||
WINK = "wink" | ||
LOCK = "lock" | ||
UNLOCK = "unlock" | ||
UNDEPLOY = "undeploy" | ||
UP = "up" | ||
|
||
|
||
@unique | ||
class OverkizCommandParam(str, Enum): | ||
"""Parameter used by Overkiz commands and/or states.""" | ||
|
||
ABSENCE = "absence" | ||
ARMED = "armed" | ||
ARMED_DAY = "armedDay" | ||
ARMED_NIGHT = "armedNight" | ||
AWAY = "away" | ||
AUTO = "auto" | ||
AUTO_MODE = "autoMode" | ||
AVAILABLE = "available" | ||
BOOST = "boost" | ||
COMFORT = "comfort" | ||
CLOSED = "closed" | ||
DEAD = "dead" | ||
DETECTED = "detected" | ||
DISARMED = "disarmed" | ||
ECO = "eco" | ||
FREE = "free" | ||
FROSTPROTECTION = "frostprotection" | ||
FULL = "full" | ||
GEOFENCING_MODE = "geofencingMode" | ||
HIGH_DEMAND = "high demand" # not a typo... | ||
HIGHEST = "highest" | ||
LOW = "low" | ||
LOCKED = "locked" | ||
MANU = "manu" | ||
MANUAL = "manual" | ||
MANUAL_ECO_ACTIVE = "manualEcoActive" | ||
MANUAL_ECO_INACTIVE = "manualEcoInactive" | ||
NORMAL = "normal" | ||
ON = "on" | ||
OFF = "off" | ||
OPEN = "open" | ||
PARTIAL = "partial" | ||
PENDING = "pending" | ||
PEDESTRIAN = "pedestrian" | ||
PERSON_INSIDE = "personInside" | ||
PROG = "prog" | ||
RELAUNCH = "relaunch" | ||
SECURED = "secured" | ||
STANDARD = "standard" | ||
STOP = "stop" | ||
TOTAL = "total" | ||
UNDETECTED = "undetected" | ||
VERY_LOW = "verylow" | ||
ZONE_1 = "zone1" | ||
ZONE_2 = "zone2" | ||
|
||
|
||
@unique | ||
class CommandMode(str, Enum): | ||
HIGH_PRIORITY = "highPriority" | ||
GEOLOCATED = "geolocated" | ||
INTERNAL = "internal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from enum import Enum, unique | ||
|
||
|
||
@unique | ||
class ExecutionType(str, Enum): | ||
IMMEDIATE_EXECUTION = "Immediate execution" | ||
DELAYED_EXECUTION = "Delayed execution" | ||
TECHNICAL_EXECUTION = "Technical execution" | ||
PLANNING = "Planning" | ||
RAW_TRIGGER_SERVER = "Raw trigger (Server)" | ||
RAW_TRIGGER_GATEWAY = "Raw trigger (Gateway)" | ||
|
||
|
||
@unique | ||
class ExecutionState(str, Enum): | ||
INITIALIZED = "INITIALIZED" | ||
NOT_TRANSMITTED = "NOT_TRANSMITTED" | ||
TRANSMITTED = "TRANSMITTED" | ||
IN_PROGRESS = "IN_PROGRESS" | ||
COMPLETED = "COMPLETED" | ||
FAILED = "FAILED" | ||
QUEUED_GATEWAY_SIDE = "QUEUED_GATEWAY_SIDE" | ||
QUEUED_SERVER_SIDE = "QUEUED_SERVER_SIDE" | ||
|
||
|
||
@unique | ||
class ExecutionSubType(str, Enum): | ||
ACTION_GROUP = "ACTION_GROUP" | ||
ACTION_GROUP_SEQUENCE = "ACTION_GROUP_SEQUENCE" | ||
DAWN_TRIGGER = "DAWN_TRIGGER" | ||
DUSK_TRIGGER = "DUSK_TRIGGER" | ||
DISCRETE_TRIGGER_USER = "DISCRETE_TRIGGER_USER" | ||
GENERIC_COMMAND_SCHEDULING = "GENERIC_COMMAND_SCHEDULING" | ||
IFT_CONDITION = "IFT_CONDITION" | ||
INTERNAL = "INTERNAL" | ||
MANUAL_CONTROL = "MANUAL_CONTROL" | ||
NO_ERROR = "NO_ERROR" | ||
P2P_COMMAND_REGULATION = "P2P_COMMAND_REGULATION" | ||
TIME_TRIGGER = "TIME_TRIGGER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import logging | ||
from enum import Enum, IntEnum, unique | ||
|
||
_LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
@unique | ||
class GatewayType(IntEnum): | ||
UNKNOWN = -1 | ||
VIRTUAL_KIZBOX = 0 | ||
KIZBOX_V1 = 2 | ||
TAHOMA = 15 | ||
VERISURE_ALARM_SYSTEM = 20 | ||
KIZBOX_MINI = 21 | ||
HI_KUMO_ADAPTER = 22 # Hi Kumo Adapter SPX-WFG01 (constant added manually) | ||
KIZBOX_V2 = 24 | ||
MYFOX_ALARM_SYSTEM = 25 | ||
KIZBOX_MINI_VMBUS = 27 | ||
KIZBOX_MINI_IO = 28 | ||
TAHOMA_V2 = 29 | ||
KIZBOX_V2_3H = 30 | ||
KIZBOX_V2_2H = 31 | ||
COZYTOUCH = 32 | ||
CONNEXOON = 34 | ||
JSW_CAMERA = 35 | ||
TAHOMA_V2_RTS = 41 | ||
KIZBOX_MINI_MODBUS = 42 | ||
KIZBOX_MINI_OVP = 43 | ||
HI_BOX = 44 # Hi Kumo AHP-SMB01 Hi Box (constant added manually) | ||
CONNEXOON_RTS = 53 | ||
OPENDOORS_LOCK_SYSTEM = 54 | ||
CONNEXOON_RTS_JAPAN = 56 | ||
HOME_PROTECT_SYSTEM = 58 | ||
CONNEXOON_RTS_AUSTRALIA = 62 | ||
THERMOSTAT_SOMFY_SYSTEM = 63 | ||
SMARTLY_MINI_DAUGHTERBOARD_ZWAVE = 65 | ||
SMARTLY_MINIBOX_RAILDIN = 66 | ||
TAHOMA_BEE = 67 | ||
TAHOMA_RAIL_DIN = 72 | ||
NEXITY_RAIL_DIN = 74 | ||
ELIOT = 77 | ||
WISER = 88 | ||
TAHOMA_SWITCH = 98 | ||
|
||
@classmethod | ||
def _missing_(cls, value): # type: ignore | ||
_LOGGER.warning(f"Unsupported value {value} has been returned for {cls}") | ||
return cls.UNKNOWN | ||
|
||
@property | ||
def beautify_name(self) -> str: | ||
return self.name.replace("_", " ").title() | ||
|
||
|
||
@unique | ||
class GatewaySubType(IntEnum): | ||
UNKNOWN = -1 | ||
TAHOMA_BASIC = 1 | ||
TAHOMA_BASIC_PLUS = 2 | ||
TAHOMA_PREMIUM = 3 | ||
SOMFY_BOX = 4 | ||
HITACHI_BOX = 5 | ||
MONDIAL_BOX = 6 | ||
MAROC_TELECOM_BOX = 7 | ||
TAHOMA_SERENITY = 8 | ||
TAHOMA_VERISURE = 9 | ||
TAHOMA_SERENITY_PREMIUM = 10 | ||
TAHOMA_MONSIEUR_STORE = 11 | ||
TAHOMA_MAISON_AVENIR_ET_TRADITION = 12 | ||
TAHOMA_SHORT_CHANNEL = 13 | ||
TAHOMA_PRO = 14 | ||
TAHOMA_SECURITY_SHORT_CHANNEL = 15 | ||
TAHOMA_SECURITY_PRO = 16 | ||
# TAHOMA_BOX_C_IO = 12 That’s probably 17, but tahomalink.com says it’s 12 | ||
|
||
@classmethod | ||
def _missing_(cls, value): # type: ignore | ||
_LOGGER.warning(f"Unsupported value {value} has been returned for {cls}") | ||
return cls.UNKNOWN | ||
|
||
@property | ||
def beautify_name(self) -> str: | ||
return self.name.replace("_", " ").title() | ||
|
||
|
||
@unique | ||
class UpdateBoxStatus(str, Enum): | ||
NOT_UPDATABLE = "NOT_UPDATABLE" | ||
READY_TO_UPDATE = "READY_TO_UPDATE" | ||
READY_TO_BE_UPDATED_BY_SERVER = "READY_TO_BE_UPDATED_BY_SERVER" | ||
READY_TO_UPDATE_LOCALLY = "READY_TO_UPDATE_LOCALLY" | ||
UP_TO_DATE = "UP_TO_DATE" | ||
UNKNOWN = "UNKNOWN" | ||
UPDATING = "UPDATING" |
Oops, something went wrong.