Skip to content

Commit f70aeaf

Browse files
authored
Bump aiohomeconnect to version 0.23.1 (home-assistant#156454)
1 parent e2279b3 commit f70aeaf

File tree

7 files changed

+52
-8
lines changed

7 files changed

+52
-8
lines changed

homeassistant/components/home_connect/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
"iot_class": "cloud_push",
2323
"loggers": ["aiohomeconnect"],
2424
"quality_scale": "platinum",
25-
"requirements": ["aiohomeconnect==0.23.0"],
25+
"requirements": ["aiohomeconnect==0.23.1"],
2626
"zeroconf": ["_homeconnect._tcp.local."]
2727
}

homeassistant/components/home_connect/select.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ def update_native_value(self) -> None:
412412
"""Set the program value."""
413413
event = self.appliance.events.get(cast(EventKey, self.bsh_key))
414414
self._attr_current_option = (
415-
PROGRAMS_TRANSLATION_KEYS_MAP.get(cast(ProgramKey, event.value))
416-
if event
415+
PROGRAMS_TRANSLATION_KEYS_MAP.get(ProgramKey(event_value))
416+
if event and isinstance(event_value := event.value, str)
417417
else None
418418
)
419419

homeassistant/components/home_connect/sensor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,11 @@ def update_native_value(self) -> None:
556556
status = self.appliance.status[cast(StatusKey, self.bsh_key)].value
557557
self._update_native_value(status)
558558

559-
def _update_native_value(self, status: str | float) -> None:
559+
def _update_native_value(self, status: str | float | None) -> None:
560560
"""Set the value of the sensor based on the given value."""
561+
if status is None:
562+
self._attr_native_value = None
563+
return
561564
match self.device_class:
562565
case SensorDeviceClass.TIMESTAMP:
563566
self._attr_native_value = dt_util.utcnow() + timedelta(

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/components/home_connect/test_select.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ async def test_filter_programs(
347347
],
348348
indirect=["appliance"],
349349
)
350+
@pytest.mark.parametrize("program_value", ["A not known program", None])
350351
async def test_select_program_functionality(
351352
hass: HomeAssistant,
352353
client: MagicMock,
@@ -359,6 +360,7 @@ async def test_select_program_functionality(
359360
program_key: ProgramKey,
360361
program_to_set: str,
361362
event_key: EventKey,
363+
program_value: str,
362364
) -> None:
363365
"""Test select functionality."""
364366
assert await integration_setup(client)
@@ -389,7 +391,7 @@ async def test_select_program_functionality(
389391
timestamp=0,
390392
level="",
391393
handling="",
392-
value="A not known program",
394+
value=program_value,
393395
)
394396
]
395397
),

tests/components/home_connect/test_sensor.py

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@
7575
},
7676
}
7777

78+
79+
EVENT_PROG_UPDATE_3 = {
80+
EventType.EVENT: {
81+
EventKey.BSH_COMMON_OPTION_REMAINING_PROGRAM_TIME: None,
82+
EventKey.BSH_COMMON_OPTION_PROGRAM_PROGRESS: 99,
83+
},
84+
EventType.STATUS: {
85+
EventKey.BSH_COMMON_STATUS_OPERATION_STATE: "BSH.Common.EnumType.OperationState.Run",
86+
},
87+
}
88+
7889
EVENT_PROG_END = {
7990
EventType.STATUS: {
8091
EventKey.BSH_COMMON_STATUS_OPERATION_STATE: "BSH.Common.EnumType.OperationState.Ready",
@@ -266,6 +277,7 @@ async def test_sensor_entity_availability(
266277
EVENT_PROG_RUN,
267278
EVENT_PROG_UPDATE_1,
268279
EVENT_PROG_UPDATE_2,
280+
EVENT_PROG_UPDATE_3,
269281
EVENT_PROG_END,
270282
)
271283

@@ -276,20 +288,23 @@ async def test_sensor_entity_availability(
276288
"run",
277289
"run",
278290
"run",
291+
"run",
279292
"ready",
280293
),
281294
"sensor.dishwasher_program_finish_time": (
282295
"unavailable",
283296
"2021-01-09T12:00:00+00:00",
284297
"2021-01-09T12:00:00+00:00",
285298
"2021-01-09T12:00:20+00:00",
299+
STATE_UNKNOWN,
286300
"unavailable",
287301
),
288302
"sensor.dishwasher_program_progress": (
289303
"unavailable",
290304
"60",
291305
"80",
292306
"99",
307+
"99",
293308
"unavailable",
294309
),
295310
}
@@ -535,6 +550,14 @@ async def test_remaining_prog_time_edge_cases(
535550
"open",
536551
"Dishwasher",
537552
),
553+
(
554+
"sensor.dishwasher_door",
555+
EventKey.BSH_COMMON_STATUS_DOOR_STATE,
556+
EventType.STATUS,
557+
None,
558+
STATE_UNKNOWN,
559+
"Dishwasher",
560+
),
538561
(
539562
"sensor.fridgefreezer_freezer_door_alarm",
540563
"EVENT_NOT_IN_STATUS_YET_SO_SET_TO_OFF",
@@ -567,6 +590,14 @@ async def test_remaining_prog_time_edge_cases(
567590
"confirmed",
568591
"FridgeFreezer",
569592
),
593+
(
594+
"sensor.fridgefreezer_freezer_door_alarm",
595+
EventKey.REFRIGERATION_FRIDGE_FREEZER_EVENT_DOOR_ALARM_FREEZER,
596+
EventType.EVENT,
597+
None,
598+
STATE_UNKNOWN,
599+
"FridgeFreezer",
600+
),
570601
(
571602
"sensor.coffeemaker_bean_container_empty",
572603
EventType.EVENT,
@@ -599,6 +630,14 @@ async def test_remaining_prog_time_edge_cases(
599630
"confirmed",
600631
"CoffeeMaker",
601632
),
633+
(
634+
"sensor.coffeemaker_bean_container_empty",
635+
EventKey.CONSUMER_PRODUCTS_COFFEE_MAKER_EVENT_BEAN_CONTAINER_EMPTY,
636+
EventType.EVENT,
637+
None,
638+
STATE_UNKNOWN,
639+
"CoffeeMaker",
640+
),
602641
],
603642
indirect=["appliance"],
604643
)
@@ -610,7 +649,7 @@ async def test_sensors_states(
610649
entity_id: str,
611650
event_key: EventKey,
612651
event_type: EventType,
613-
event_value_update: str,
652+
event_value_update: str | None,
614653
appliance: HomeAppliance,
615654
expected: str,
616655
) -> None:

0 commit comments

Comments
 (0)