Index: leahi_dialin/td/modules/switches.py =================================================================== diff -u -rec8a2600b9e8cf6fe7e02c200a1c24221ca86863 -rd27c40205e18118f4689f62463a266da1f91dba6 --- leahi_dialin/td/modules/switches.py (.../switches.py) (revision ec8a2600b9e8cf6fe7e02c200a1c24221ca86863) +++ leahi_dialin/td/modules/switches.py (.../switches.py) (revision d27c40205e18118f4689f62463a266da1f91dba6) @@ -20,7 +20,7 @@ from leahi_dialin.utils.conversions import integer_to_bytearray from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions -from leahi_dialin.common.td_defs import TDSwitchStatus, TDSwitchesNames +from leahi_dialin.common.td_defs import td_enum_repository from .constants import RESET, NO_RESET from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish, DialinEnum @@ -48,7 +48,7 @@ self.can_interface.register_receiving_publication_function(channel_id, self.msg_id_td_switches_data, self._handler_switches_sync) - self.td_switches_status = {TDSwitchesNames.H9_FRONT_DOOR.name: TDSwitchStatus.CLOSED.value} + self.td_switches_status = {td_enum_repository.TDSwitchNames.H9_FRONT_DOOR.name: td_enum_repository.TDSwitchStatus.CLOSED.value} self.td_switches_timestamp = 0.0 @publish(["msg_id_td_switches_data", "td_switches_status", "td_switches_timestamp"]) @@ -62,7 +62,7 @@ front_door = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] - self.td_switches_status[TDSwitchesNames.H9_FRONT_DOOR.name] = TDSwitchStatus(front_door).value + self.td_switches_status[td_enum_repository.TDSwitchNames.H9_FRONT_DOOR.name] = td_enum_repository.TDSwitchStatus(front_door).value self.td_switches_timestamp = timestamp def cmd_switch_status_override(self, switch: int, status: int, reset: int = NO_RESET) -> int: @@ -93,7 +93,7 @@ # If there is no content... if received_message is not None: - self.logger.debug("Switch " + str(TDSwitchesNames(switch).name) + " to: " + + self.logger.debug("Switch " + str(td_enum_repository.TDSwitchNames(switch).name) + " to: " + str(received_message['message'][DenaliMessage.PAYLOAD_START_INDEX])) # response payload is OK or not OK return received_message['message'][DenaliMessage.PAYLOAD_START_INDEX]