mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 16:17:20 +00:00
Bump Plugwise to v1.7.8 preventing rogue KeyError (#149000)
This commit is contained in:
parent
d823b574c0
commit
8f795f021c
@ -165,7 +165,7 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
|
|||||||
if "regulation_modes" in self._gateway_data:
|
if "regulation_modes" in self._gateway_data:
|
||||||
hvac_modes.append(HVACMode.OFF)
|
hvac_modes.append(HVACMode.OFF)
|
||||||
|
|
||||||
if "available_schedules" in self.device:
|
if self.device.get("available_schedules"):
|
||||||
hvac_modes.append(HVACMode.AUTO)
|
hvac_modes.append(HVACMode.AUTO)
|
||||||
|
|
||||||
if self.coordinator.api.cooling_present:
|
if self.coordinator.api.cooling_present:
|
||||||
|
@ -8,6 +8,6 @@
|
|||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["plugwise"],
|
"loggers": ["plugwise"],
|
||||||
"quality_scale": "platinum",
|
"quality_scale": "platinum",
|
||||||
"requirements": ["plugwise==1.7.7"],
|
"requirements": ["plugwise==1.7.8"],
|
||||||
"zeroconf": ["_plugwise._tcp.local."]
|
"zeroconf": ["_plugwise._tcp.local."]
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ async def async_setup_entry(
|
|||||||
PlugwiseSelectEntity(coordinator, device_id, description)
|
PlugwiseSelectEntity(coordinator, device_id, description)
|
||||||
for device_id in coordinator.new_devices
|
for device_id in coordinator.new_devices
|
||||||
for description in SELECT_TYPES
|
for description in SELECT_TYPES
|
||||||
if description.options_key in coordinator.data[device_id]
|
if coordinator.data[device_id].get(description.options_key)
|
||||||
)
|
)
|
||||||
|
|
||||||
_add_entities()
|
_add_entities()
|
||||||
@ -98,7 +98,7 @@ class PlugwiseSelectEntity(PlugwiseEntity, SelectEntity):
|
|||||||
self._location = location
|
self._location = location
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_option(self) -> str:
|
def current_option(self) -> str | None:
|
||||||
"""Return the selected entity option to represent the entity state."""
|
"""Return the selected entity option to represent the entity state."""
|
||||||
return self.device[self.entity_description.key]
|
return self.device[self.entity_description.key]
|
||||||
|
|
||||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -1693,7 +1693,7 @@ plexauth==0.0.6
|
|||||||
plexwebsocket==0.0.14
|
plexwebsocket==0.0.14
|
||||||
|
|
||||||
# homeassistant.components.plugwise
|
# homeassistant.components.plugwise
|
||||||
plugwise==1.7.7
|
plugwise==1.7.8
|
||||||
|
|
||||||
# homeassistant.components.plum_lightpad
|
# homeassistant.components.plum_lightpad
|
||||||
plumlightpad==0.0.11
|
plumlightpad==0.0.11
|
||||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -1431,7 +1431,7 @@ plexauth==0.0.6
|
|||||||
plexwebsocket==0.0.14
|
plexwebsocket==0.0.14
|
||||||
|
|
||||||
# homeassistant.components.plugwise
|
# homeassistant.components.plugwise
|
||||||
plugwise==1.7.7
|
plugwise==1.7.8
|
||||||
|
|
||||||
# homeassistant.components.plum_lightpad
|
# homeassistant.components.plum_lightpad
|
||||||
plumlightpad==0.0.11
|
plumlightpad==0.0.11
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
{
|
{
|
||||||
"06aecb3d00354375924f50c47af36bd2": {
|
"06aecb3d00354375924f50c47af36bd2": {
|
||||||
"active_preset": "no_frost",
|
"active_preset": "no_frost",
|
||||||
|
"available_schedules": [],
|
||||||
"climate_mode": "off",
|
"climate_mode": "off",
|
||||||
"dev_class": "climate",
|
"dev_class": "climate",
|
||||||
"model": "ThermoZone",
|
"model": "ThermoZone",
|
||||||
"name": "Slaapkamer",
|
"name": "Slaapkamer",
|
||||||
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
|
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
|
||||||
|
"select_schedule": null,
|
||||||
"sensors": {
|
"sensors": {
|
||||||
"temperature": 24.2
|
"temperature": 24.2
|
||||||
},
|
},
|
||||||
@ -23,12 +25,14 @@
|
|||||||
},
|
},
|
||||||
"13228dab8ce04617af318a2888b3c548": {
|
"13228dab8ce04617af318a2888b3c548": {
|
||||||
"active_preset": "home",
|
"active_preset": "home",
|
||||||
|
"available_schedules": [],
|
||||||
"climate_mode": "heat",
|
"climate_mode": "heat",
|
||||||
"control_state": "idle",
|
"control_state": "idle",
|
||||||
"dev_class": "climate",
|
"dev_class": "climate",
|
||||||
"model": "ThermoZone",
|
"model": "ThermoZone",
|
||||||
"name": "Woonkamer",
|
"name": "Woonkamer",
|
||||||
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
|
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
|
||||||
|
"select_schedule": null,
|
||||||
"sensors": {
|
"sensors": {
|
||||||
"temperature": 27.4
|
"temperature": 27.4
|
||||||
},
|
},
|
||||||
@ -236,12 +240,14 @@
|
|||||||
},
|
},
|
||||||
"d27aede973b54be484f6842d1b2802ad": {
|
"d27aede973b54be484f6842d1b2802ad": {
|
||||||
"active_preset": "home",
|
"active_preset": "home",
|
||||||
|
"available_schedules": [],
|
||||||
"climate_mode": "heat",
|
"climate_mode": "heat",
|
||||||
"control_state": "idle",
|
"control_state": "idle",
|
||||||
"dev_class": "climate",
|
"dev_class": "climate",
|
||||||
"model": "ThermoZone",
|
"model": "ThermoZone",
|
||||||
"name": "Kinderkamer",
|
"name": "Kinderkamer",
|
||||||
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
|
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
|
||||||
|
"select_schedule": null,
|
||||||
"sensors": {
|
"sensors": {
|
||||||
"temperature": 30.0
|
"temperature": 30.0
|
||||||
},
|
},
|
||||||
@ -283,12 +289,14 @@
|
|||||||
},
|
},
|
||||||
"d58fec52899f4f1c92e4f8fad6d8c48c": {
|
"d58fec52899f4f1c92e4f8fad6d8c48c": {
|
||||||
"active_preset": "home",
|
"active_preset": "home",
|
||||||
|
"available_schedules": [],
|
||||||
"climate_mode": "heat",
|
"climate_mode": "heat",
|
||||||
"control_state": "idle",
|
"control_state": "idle",
|
||||||
"dev_class": "climate",
|
"dev_class": "climate",
|
||||||
"model": "ThermoZone",
|
"model": "ThermoZone",
|
||||||
"name": "Logeerkamer",
|
"name": "Logeerkamer",
|
||||||
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
|
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
|
||||||
|
"select_schedule": null,
|
||||||
"sensors": {
|
"sensors": {
|
||||||
"temperature": 30.0
|
"temperature": 30.0
|
||||||
},
|
},
|
||||||
|
@ -433,13 +433,16 @@ async def test_anna_climate_entity_climate_changes(
|
|||||||
"c784ee9fdab44e1395b8dee7d7a497d5", HVACMode.OFF
|
"c784ee9fdab44e1395b8dee7d7a497d5", HVACMode.OFF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Mock user deleting last schedule from app or browser
|
||||||
data = mock_smile_anna.async_update.return_value
|
data = mock_smile_anna.async_update.return_value
|
||||||
data["3cb70739631c4d17a86b8b12e8a5161b"].pop("available_schedules")
|
data["3cb70739631c4d17a86b8b12e8a5161b"]["available_schedules"] = []
|
||||||
|
data["3cb70739631c4d17a86b8b12e8a5161b"]["select_schedule"] = None
|
||||||
|
data["3cb70739631c4d17a86b8b12e8a5161b"]["climate_mode"] = "heat_cool"
|
||||||
with patch(HA_PLUGWISE_SMILE_ASYNC_UPDATE, return_value=data):
|
with patch(HA_PLUGWISE_SMILE_ASYNC_UPDATE, return_value=data):
|
||||||
freezer.tick(timedelta(minutes=1))
|
freezer.tick(timedelta(minutes=1))
|
||||||
async_fire_time_changed(hass)
|
async_fire_time_changed(hass)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
state = hass.states.get("climate.anna")
|
state = hass.states.get("climate.anna")
|
||||||
assert state.state == HVACMode.HEAT
|
assert state.state == HVACMode.HEAT_COOL
|
||||||
assert state.attributes[ATTR_HVAC_MODES] == [HVACMode.HEAT_COOL]
|
assert state.attributes[ATTR_HVAC_MODES] == [HVACMode.HEAT_COOL]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user