mirror of
https://github.com/USA-RedDragon/badnest.git
synced 2025-01-18 18:30:43 +00:00
Merge pull request #18 from USA-RedDragon/visual-bug-auto-mode
Fix a visual bug wherein the mode kept going into the 'unknown' state
This commit is contained in:
commit
977c553a8d
@ -136,6 +136,7 @@ class NestThermostatAPI(NestAPI):
|
||||
|
||||
self._czfe_url = r.json()["service_urls"]["urls"]["czfe_url"]
|
||||
|
||||
temp_mode = None
|
||||
for bucket in r.json()["updated_buckets"]:
|
||||
if bucket["object_key"].startswith(f"shared.{self._device_id}"):
|
||||
thermostat_data = bucket["value"]
|
||||
@ -150,8 +151,7 @@ class NestThermostatAPI(NestAPI):
|
||||
]
|
||||
self._hvac_ac_state = thermostat_data["hvac_ac_state"]
|
||||
self._hvac_heater_state = thermostat_data["hvac_heater_state"]
|
||||
if self.mode != 'eco':
|
||||
self.mode = thermostat_data["target_temperature_type"]
|
||||
temp_mode = thermostat_data["target_temperature_type"]
|
||||
self.target_temperature_high = thermostat_data[
|
||||
"target_temperature_high"
|
||||
]
|
||||
@ -167,9 +167,8 @@ class NestThermostatAPI(NestAPI):
|
||||
self.fan = thermostat_data["fan_timer_timeout"] > 0
|
||||
self.current_humidity = thermostat_data["current_humidity"]
|
||||
if thermostat_data["eco"]["mode"] == 'manual-eco':
|
||||
self.mode = 'eco'
|
||||
else:
|
||||
self.mode = 'unknown'
|
||||
temp_mode = 'eco'
|
||||
self.mode = temp_mode
|
||||
|
||||
def set_temp(self, temp, temp_high=None):
|
||||
if temp_high is None:
|
||||
|
@ -192,9 +192,7 @@ class NestClimate(ClimateDevice):
|
||||
@property
|
||||
def hvac_mode(self):
|
||||
"""Return hvac target hvac state."""
|
||||
if self.device.mode == 'unknown' \
|
||||
or self.device.mode == NEST_MODE_ECO \
|
||||
or self.device.mode is None:
|
||||
if self.device.mode is None or self.device.mode == NEST_MODE_ECO:
|
||||
# We assume the first operation in operation list is the main one
|
||||
return self._operation_list[0]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user