Add coverage for binary_sensor platform to esphome (#95067)

This commit is contained in:
J. Nick Koston 2023-06-22 19:55:28 +02:00 committed by GitHub
parent 6ad3b60adf
commit 1cf4a008c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 89 additions and 5 deletions

View file

@ -49,10 +49,10 @@ class EsphomeBinarySensor(
# Status binary sensors indicated connected state.
# So in their case what's usually _availability_ is now state
return self._entry_data.available
if not self._has_state:
return None
state = self._state
return None if state.missing_state else state.state
if not self._has_state or state.missing_state:
return None
return state.state
@callback
def _on_static_info_update(self, static_info: EntityInfo) -> None: