mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Handle disconnected ecobee thermostat in humidifier and remote sensors (#51873)
This commit is contained in:
parent
c0a0c8b283
commit
c149ecf2cc
@ -80,6 +80,12 @@ class EcobeeBinarySensor(BinarySensorEntity):
|
|||||||
}
|
}
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def available(self):
|
||||||
|
"""Return true if device is available."""
|
||||||
|
thermostat = self.data.ecobee.get_thermostat(self.index)
|
||||||
|
return thermostat["runtime"]["connected"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""Return the status of the sensor."""
|
"""Return the status of the sensor."""
|
||||||
|
@ -69,6 +69,11 @@ class EcobeeHumidifier(HumidifierEntity):
|
|||||||
"model": model,
|
"model": model,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def available(self):
|
||||||
|
"""Return if device is available."""
|
||||||
|
return self.thermostat["runtime"]["connected"]
|
||||||
|
|
||||||
async def async_update(self):
|
async def async_update(self):
|
||||||
"""Get the latest state from the thermostat."""
|
"""Get the latest state from the thermostat."""
|
||||||
if self.update_without_throttle:
|
if self.update_without_throttle:
|
||||||
|
@ -92,6 +92,12 @@ class EcobeeSensor(SensorEntity):
|
|||||||
}
|
}
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def available(self):
|
||||||
|
"""Return true if device is available."""
|
||||||
|
thermostat = self.data.ecobee.get_thermostat(self.index)
|
||||||
|
return thermostat["runtime"]["connected"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""Return the device class of the sensor."""
|
"""Return the device class of the sensor."""
|
||||||
|
@ -22,6 +22,7 @@ def ecobee_fixture():
|
|||||||
"currentClimateRef": "c1",
|
"currentClimateRef": "c1",
|
||||||
},
|
},
|
||||||
"runtime": {
|
"runtime": {
|
||||||
|
"connected": True,
|
||||||
"actualTemperature": 300,
|
"actualTemperature": 300,
|
||||||
"actualHumidity": 15,
|
"actualHumidity": 15,
|
||||||
"desiredHeat": 400,
|
"desiredHeat": 400,
|
||||||
|
2
tests/fixtures/ecobee/ecobee-data.json
vendored
2
tests/fixtures/ecobee/ecobee-data.json
vendored
@ -12,7 +12,7 @@
|
|||||||
"currentClimateRef": "c1"
|
"currentClimateRef": "c1"
|
||||||
},
|
},
|
||||||
"runtime": {
|
"runtime": {
|
||||||
"connected": false,
|
"connected": true,
|
||||||
"actualTemperature": 300,
|
"actualTemperature": 300,
|
||||||
"actualHumidity": 15,
|
"actualHumidity": 15,
|
||||||
"desiredHeat": 400,
|
"desiredHeat": 400,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user