Fix esphome binary sensors when state is missing (#95140)
* Fix esphome binary sensors when state is missing * Fix esphome binary sensors when state is missing * Fix esphome binary sensors when state is missing
This commit is contained in:
parent
c6b3d538de
commit
9eedc8a602
3 changed files with 125 additions and 16 deletions
|
@ -49,10 +49,9 @@ class EsphomeBinarySensor(
|
|||
# Status binary sensors indicated connected state.
|
||||
# So in their case what's usually _availability_ is now state
|
||||
return self._entry_data.available
|
||||
state = self._state
|
||||
if not self._has_state or state.missing_state:
|
||||
if not self._has_state or self._state.missing_state:
|
||||
return None
|
||||
return state.state
|
||||
return self._state.state
|
||||
|
||||
@callback
|
||||
def _on_static_info_update(self, static_info: EntityInfo) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue