Handle CO2Signal response value being None (#54377)
This commit is contained in:
parent
3202d4882a
commit
934662cd54
1 changed files with 2 additions and 1 deletions
|
@ -118,7 +118,8 @@ class CO2Sensor(update_coordinator.CoordinatorEntity[CO2SignalResponse], SensorE
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
"""Return True if entity is available."""
|
"""Return True if entity is available."""
|
||||||
return (
|
return (
|
||||||
super().available and self._description.key in self.coordinator.data["data"]
|
super().available
|
||||||
|
and self.coordinator.data["data"].get(self._description.key) is not None
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Reference in a new issue