def device_state_attributes(self):
     """Attributes of the area."""
     attrs = self.initial_attrs()
     elmt = self._element
     attrs["is_exit"] = elmt.is_exit
     attrs["timer1"] = elmt.timer1
     attrs["timer2"] = elmt.timer2
     if elmt.armed_status is not None:
         attrs["armed_status"] = ArmedStatus(elmt.armed_status).name.lower()
     if elmt.arm_up_state is not None:
         attrs["arm_up_state"] = ArmUpState(elmt.arm_up_state).name.lower()
     if elmt.alarm_state is not None:
         attrs["alarm_state"] = AlarmState(elmt.alarm_state).name.lower()
     attrs["changed_by_keypad"] = self._changed_by_keypad
     return attrs
Пример #2
0
 def extra_state_attributes(self) -> dict[str, Any]:
     """Attributes of the area."""
     attrs = self.initial_attrs()
     elmt = self._element
     attrs["is_exit"] = elmt.is_exit
     attrs["timer1"] = elmt.timer1
     attrs["timer2"] = elmt.timer2
     if elmt.armed_status is not None:
         attrs["armed_status"] = ArmedStatus(elmt.armed_status).name.lower()
     if elmt.arm_up_state is not None:
         attrs["arm_up_state"] = ArmUpState(elmt.arm_up_state).name.lower()
     if elmt.alarm_state is not None:
         attrs["alarm_state"] = AlarmState(elmt.alarm_state).name.lower()
     attrs[ATTR_CHANGED_BY_KEYPAD] = self._changed_by_keypad
     attrs[ATTR_CHANGED_BY_TIME] = self._changed_by_time
     attrs[ATTR_CHANGED_BY_ID] = self._changed_by_id
     return attrs
Пример #3
0
    def device_state_attributes(self):
        """Attributes of the area."""
        from elkm1_lib.const import AlarmState, ArmedStatus, ArmUpState

        attrs = self.initial_attrs()
        elmt = self._element
        attrs['is_exit'] = elmt.is_exit
        attrs['timer1'] = elmt.timer1
        attrs['timer2'] = elmt.timer2
        if elmt.armed_status is not None:
            attrs['armed_status'] = \
                ArmedStatus(elmt.armed_status).name.lower()
        if elmt.arm_up_state is not None:
            attrs['arm_up_state'] = ArmUpState(elmt.arm_up_state).name.lower()
        if elmt.alarm_state is not None:
            attrs['alarm_state'] = AlarmState(elmt.alarm_state).name.lower()
        attrs['changed_by_entity_id'] = self._changed_by_entity_id
        return attrs