custom_components/keymaster/__init__.py
def _invalid_code(self, code_slot):
        """Return the PIN slot value as we are unable to read the slot value
        from the lock."""

        _LOGGER.debug("Work around code in use.")
        # This is a fail safe and should not be needing to return ""
        data = ""

        # Build data from entities
        active_binary_sensor = (
            f"binary_sensor.active_{self._primary_lock.lock_name}_{code_slot}"
        )
        active = self.hass.states.get(active_binary_sensor)
        pin_data = f"input_text.{self._primary_lock.lock_name}_pin_{code_slot}"
        pin = self.hass.states.get(pin_data)

        # If slot is enabled return the PIN
        if active is not None and pin is not None:
            if active.state == "on" and pin.state.isnumeric():
                _LOGGER.debug("Utilizing BE469 work around code.")
                data = pin.state
            else:
                _LOGGER.debug("Utilizing FE599 work around code.")
                data = ""

        return data
Return the PIN slot value as we are unable to read the slot value
        from the lock.
Return the PIN slot value as we are unable to read the slot value
from the lock.
Return the PIN slot value as we are unable to read the slot value from the lock .
def _invalid_code(self, code_slot):
        _LOGGER.debug("Work around code in use.")
        data = ""
        active_binary_sensor = (
            f"binary_sensor.active_{self._primary_lock.lock_name}_{code_slot}"
        )
        active = self.hass.states.get(active_binary_sensor)
        pin_data = f"input_text.{self._primary_lock.lock_name}_pin_{code_slot}"
        pin = self.hass.states.get(pin_data)
        if active is not None and pin is not None:
            if active.state == "on" and pin.state.isnumeric():
                _LOGGER.debug("Utilizing BE469 work around code.")
                data = pin.state
            else:
                _LOGGER.debug("Utilizing FE599 work around code.")
                data = ""
        return data
def _invalid_code ( self , code_slot ) : _LOGGER . debug ( "Work around code in use." ) data = "" active_binary_sensor = ( f"binary_sensor.active_{self._primary_lock.lock_name}_{code_slot}" ) active = self . hass . states . get ( active_binary_sensor ) pin_data = f"input_text.{self._primary_lock.lock_name}_pin_{code_slot}" pin = self . hass . states . get ( pin_data ) if active is not None and pin is not None : if active . state == "on" and pin . state . isnumeric ( ) : _LOGGER . debug ( "Utilizing BE469 work around code." ) data = pin . state else : _LOGGER . debug ( "Utilizing FE599 work around code." ) data = "" return data
Return the PIN slot value as we are unable to read the slot value
from the lock.
Return the PIN slot value as we are unable to read the slot value from the lock .
"""Return the PIN slot value as we are unable to read the slot value
        from the lock.""" # This is a fail safe and should not be needing to return "" # Build data from entities # If slot is enabled return the PIN
self
code_slot