17c4f4d3914a90ec9270bb5688052ecfa6ac8b85,homeassistant/components/lock/zwave.py,ZwaveLock,update_properties,#ZwaveLock#,212

Before Change


                continue
            self._notification = LOCK_NOTIFICATION.get(value.data)
            if self._notification:
                self._state = LOCK_STATUS.get(value.data)
                _LOGGER.debug("Lock state set from Access Control value and"
                              " is %s", value.data)
            break

        for value in self._node.get_values(
                class_id=zwave.const.COMMAND_CLASS_ALARM).values():
            if value.label != "Alarm Type":
                continue
            alarm_type = LOCK_ALARM_TYPE.get(value.data)
            if alarm_type:
                self._state = LOCK_STATUS.get(value.data)
                _LOGGER.debug("Lock state set from Alarm Type value and"
                              " is %s", value.data)
            break

        for value in self._node.get_values(
                class_id=zwave.const.COMMAND_CLASS_ALARM).values():
            if value.label != "Alarm Level":
                continue
            alarm_level = value.data
            _LOGGER.debug("Lock alarm_level is %s", alarm_level)
            if alarm_type is 21:
                self._lock_status = "{}{}".format(
                    LOCK_ALARM_TYPE.get(alarm_type),
                    MANUAL_LOCK_ALARM_LEVEL.get(alarm_level))
            if alarm_type in ALARM_TYPE_STD:
                self._lock_status = "{}{}".format(
                    LOCK_ALARM_TYPE.get(alarm_type), alarm_level)
                break
            if alarm_type is 161:
                self._lock_status = "{}{}".format(
                    LOCK_ALARM_TYPE.get(alarm_type),
                    TAMPER_ALARM_LEVEL.get(alarm_level))
                break
            if alarm_type != 0:
                self._lock_status = LOCK_ALARM_TYPE.get(alarm_type)
                break

        if not self._notification and not self._lock_status:
            for value in self._node.get_values(
                    class_id=zwave.const.COMMAND_CLASS_DOOR_LOCK).values():
                if value.type != zwave.const.TYPE_BOOL:
                    continue
                if value.genre != zwave.const.GENRE_USER:
                    continue
                self._state = value.data
                _LOGGER.debug("Lock state set from Bool value and"
                              " is %s", value.data)
                break

After Change



    def update_properties(self):
        Callback on data changes for node values.
        for value in self._node.get_values(
                class_id=zwave.const.COMMAND_CLASS_DOOR_LOCK).values():
            if value.type != zwave.const.TYPE_BOOL:
                continue
            if value.genre != zwave.const.GENRE_USER:
                continue
            self._state = value.data
            _LOGGER.debug("Lock state set from Bool value and"
                          " is %s", value.data)
            break

        for value in self._node.get_values(
                class_id=zwave.const.COMMAND_CLASS_ALARM).values():
            if value.label != "Access Control":
                continue
            self._notification = LOCK_NOTIFICATION.get(value.data)
            notification_data = value.data
            if self._v2btze:
                for value in (self._node.get_values(
                        class_id=zwave.const.COMMAND_CLASS_CONFIGURATION)
                              .values()):
                    if value.index != 12:
                        continue
                    if value.data == CONFIG_ADVANCED:
                        self._state = LOCK_STATUS.get(notification_data)
                        _LOGGER.debug("Lock state set from Access Control "
                                      "value and is %s", notification_data)
                    break

            break

        for value in self._node.get_values(
                class_id=zwave.const.COMMAND_CLASS_ALARM).values():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: home-assistant/home-assistant
Commit Name: 17c4f4d3914a90ec9270bb5688052ecfa6ac8b85
Time: 2017-02-01
Author: turbokongen@hotmail.com
File Name: homeassistant/components/lock/zwave.py
Class Name: ZwaveLock
Method Name: update_properties


Project Name: home-assistant/home-assistant
Commit Name: c6f5a5443f18d11dce3d1ebc64d0662c67001426
Time: 2016-11-15
Author: turbokongen@hotmail.com
File Name: homeassistant/components/climate/zwave.py
Class Name: ZWaveClimate
Method Name: update_properties


Project Name: home-assistant/home-assistant
Commit Name: 17c4f4d3914a90ec9270bb5688052ecfa6ac8b85
Time: 2017-02-01
Author: turbokongen@hotmail.com
File Name: homeassistant/components/lock/zwave.py
Class Name: ZwaveLock
Method Name: update_properties


Project Name: home-assistant/home-assistant
Commit Name: 68d6bcd3edd0eaf20b081fbf154de2942b85ac45
Time: 2017-02-01
Author: turbokongen@hotmail.com
File Name: homeassistant/components/lock/zwave.py
Class Name: ZwaveLock
Method Name: update_properties