From 3978ddb1c8a7de3189c8e6b8bc947eb4e981b37a Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 10 Oct 2024 12:55:47 +0200 Subject: [PATCH] Changes --- components/tc_bus/__init__.py | 72 +++++++++++++++---------------- firmware/addons/memory-utils.yaml | 4 +- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/components/tc_bus/__init__.py b/components/tc_bus/__init__.py index c27abe1..b015960 100644 --- a/components/tc_bus/__init__.py +++ b/components/tc_bus/__init__.py @@ -33,49 +33,49 @@ ReadMemoryTimeoutTrigger = tc_bus_ns.class_("ReadMemoryTimeoutTrigger", automation.Trigger.template()) ReceivedCommandTrigger = tc_bus_ns.class_("ReceivedCommandTrigger", automation.Trigger.template()) -SettingType = tc_bus_ns.enum("Setting_Type") +SETTING_TYPE = tc_bus_ns.enum("SettingType") SETTING_TYPES = { - "ringtone_floor_call": SettingType.SETTING_RINGTONE_FLOOR_CALL, - "ringtone_door_call": SettingType.SETTING_RINGTONE_DOOR_CALL, - "ringtone_internal_call": SettingType.SETTING_RINGTONE_INTERNAL_CALL, - "volume_ringtone": SettingType.SETTING_RINGTONE_VOLUME, - "volume_handset": SettingType.SETTING_HANDSET_VOLUME + "ringtone_floor_call": SETTING_TYPE.SETTING_RINGTONE_FLOOR_CALL, + "ringtone_door_call": SETTING_TYPE.SETTING_RINGTONE_DOOR_CALL, + "ringtone_internal_call": SETTING_TYPE.SETTING_RINGTONE_INTERNAL_CALL, + "volume_ringtone": SETTING_TYPE.SETTING_RINGTONE_VOLUME, + "volume_handset": SETTING_TYPE.SETTING_HANDSET_VOLUME } -CommandType = tc_bus_ns.enum("Command_Type") +COMMAND_TYPE = tc_bus_ns.enum("CommandType") COMMAND_TYPES = { - "unknown": CommandType.COMMAND_TYPE_UNKNOWN, - "door_call": CommandType.COMMAND_TYPE_DOOR_CALL, - "floor_call": CommandType.COMMAND_TYPE_FLOOR_CALL, - "internal_call": CommandType.COMMAND_TYPE_INTERNAL_CALL, - "control_function": CommandType.COMMAND_TYPE_CONTROL_FUNCTION, - "start_talking_door_station": CommandType.COMMAND_TYPE_START_TALKING_DOOR_STATION, - "start_talking_ia": CommandType.COMMAND_TYPE_START_TALKING_IA, - "stop_talking_door_station": CommandType.COMMAND_TYPE_STOP_TALKING_DOOR_STATION, - "stop_talking_ia": CommandType.COMMAND_TYPE_STOP_TALKING_IA, - "open_door": CommandType.COMMAND_TYPE_OPEN_DOOR, - "light": CommandType.COMMAND_TYPE_LIGHT, - "door_opened": CommandType.COMMAND_TYPE_DOOR_OPENED, - "door_closed": CommandType.COMMAND_TYPE_DOOR_CLOSED, - "end_of_ringtone": CommandType.COMMAND_TYPE_END_OF_RINGTONE, - "end_of_door_readiness": CommandType.COMMAND_TYPE_END_OF_DOOR_READINESS, - "initialize_door_station": CommandType.COMMAND_TYPE_INITIALIZE_DOOR_STATION, - "reset": CommandType.COMMAND_TYPE_RESET, - "select_device_group": CommandType.COMMAND_TYPE_SELECT_DEVICE_GROUP, - "select_device_group_reset": CommandType.COMMAND_TYPE_SELECT_DEVICE_GROUP_RESET, - "search_devices": CommandType.COMMAND_TYPE_SEARCH_DEVICES, - "found_device": CommandType.COMMAND_TYPE_FOUND_DEVICE, - "found_device_subsystem": CommandType.COMMAND_TYPE_FOUND_DEVICE_SUBSYSTEM, - "programming_mode": CommandType.COMMAND_TYPE_PROGRAMMING_MODE, - "read_memory_block": CommandType.COMMAND_TYPE_READ_MEMORY_BLOCK, - "select_memory_page": CommandType.COMMAND_TYPE_SELECT_MEMORY_PAGE, - "write_memory": CommandType.COMMAND_TYPE_WRITE_MEMORY + "unknown": COMMAND_TYPE.COMMAND_TYPE_UNKNOWN, + "door_call": COMMAND_TYPE.COMMAND_TYPE_DOOR_CALL, + "floor_call": COMMAND_TYPE.COMMAND_TYPE_FLOOR_CALL, + "internal_call": COMMAND_TYPE.COMMAND_TYPE_INTERNAL_CALL, + "control_function": COMMAND_TYPE.COMMAND_TYPE_CONTROL_FUNCTION, + "start_talking_door_station": COMMAND_TYPE.COMMAND_TYPE_START_TALKING_DOOR_STATION, + "start_talking_ia": COMMAND_TYPE.COMMAND_TYPE_START_TALKING_IA, + "stop_talking_door_station": COMMAND_TYPE.COMMAND_TYPE_STOP_TALKING_DOOR_STATION, + "stop_talking_ia": COMMAND_TYPE.COMMAND_TYPE_STOP_TALKING_IA, + "open_door": COMMAND_TYPE.COMMAND_TYPE_OPEN_DOOR, + "light": COMMAND_TYPE.COMMAND_TYPE_LIGHT, + "door_opened": COMMAND_TYPE.COMMAND_TYPE_DOOR_OPENED, + "door_closed": COMMAND_TYPE.COMMAND_TYPE_DOOR_CLOSED, + "end_of_ringtone": COMMAND_TYPE.COMMAND_TYPE_END_OF_RINGTONE, + "end_of_door_readiness": COMMAND_TYPE.COMMAND_TYPE_END_OF_DOOR_READINESS, + "initialize_door_station": COMMAND_TYPE.COMMAND_TYPE_INITIALIZE_DOOR_STATION, + "reset": COMMAND_TYPE.COMMAND_TYPE_RESET, + "select_device_group": COMMAND_TYPE.COMMAND_TYPE_SELECT_DEVICE_GROUP, + "select_device_group_reset": COMMAND_TYPE.COMMAND_TYPE_SELECT_DEVICE_GROUP_RESET, + "search_devices": COMMAND_TYPE.COMMAND_TYPE_SEARCH_DEVICES, + "found_device": COMMAND_TYPE.COMMAND_TYPE_FOUND_DEVICE, + "found_device_subsystem": COMMAND_TYPE.COMMAND_TYPE_FOUND_DEVICE_SUBSYSTEM, + "programming_mode": COMMAND_TYPE.COMMAND_TYPE_PROGRAMMING_MODE, + "read_memory_block": COMMAND_TYPE.COMMAND_TYPE_READ_MEMORY_BLOCK, + "select_memory_page": COMMAND_TYPE.COMMAND_TYPE_SELECT_MEMORY_PAGE, + "write_memory": COMMAND_TYPE.COMMAND_TYPE_WRITE_MEMORY } -Model = tc_bus_ns.enum("Model") +MODEL = tc_bus_ns.enum("Model") MODELS = { - "none": Model.MODEL_NONE, - "ish_3030": Model.MODEL_ISH_3030, + "none": MODEL.MODEL_NONE, + "ish_3030": MODEL.MODEL_ISH_3030, } CONF_TC_ID = "tc_bus" diff --git a/firmware/addons/memory-utils.yaml b/firmware/addons/memory-utils.yaml index be218b9..1c5a469 100644 --- a/firmware/addons/memory-utils.yaml +++ b/firmware/addons/memory-utils.yaml @@ -24,7 +24,7 @@ number: min_value: 0 max_value: 7 step: 1 - lambda: !lambda "return id(tc_bus_intercom)->get_setting(SETTING_RINGTONE_VOLUME);" + lambda: !lambda "return id(tc_bus_intercom)->get_setting(SETTING_VOLUME_RINGTONE);" update_interval: 1s set_action: - tc_bus.update_setting: @@ -38,7 +38,7 @@ number: min_value: 0 max_value: 7 step: 1 - lambda: !lambda "return id(tc_bus_intercom)->get_setting(SETTING_HANDSET_VOLUME);" + lambda: !lambda "return id(tc_bus_intercom)->get_setting(SETTING_VOLUME_HANDSET);" update_interval: 1s set_action: - tc_bus.update_setting: