mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Prevent KeyError when Matter device sends invalid value for StartUpOnOff (#124280)
This commit is contained in:
parent
f06c21c8cc
commit
51b520db0c
@ -229,12 +229,12 @@ DISCOVERY_SCHEMAS = [
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
translation_key="startup_on_off",
|
||||
options=["On", "Off", "Toggle", "Previous"],
|
||||
measurement_to_ha=lambda x: {
|
||||
measurement_to_ha=lambda x: { # pylint: disable=unnecessary-lambda
|
||||
0: "Off",
|
||||
1: "On",
|
||||
2: "Toggle",
|
||||
None: "Previous",
|
||||
}[x],
|
||||
}.get(x),
|
||||
ha_to_native_value=lambda x: {
|
||||
"Off": 0,
|
||||
"On": 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user