From 88c3ab11137feac7f31cf769ccfe310bc752725d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 3 Feb 2022 17:44:19 -0600 Subject: [PATCH 1/2] Fix lutron_caseta button events including area name in device name (#65601) --- homeassistant/components/lutron_caseta/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/lutron_caseta/__init__.py b/homeassistant/components/lutron_caseta/__init__.py index d73e03b44d4..546bb055ca8 100644 --- a/homeassistant/components/lutron_caseta/__init__.py +++ b/homeassistant/components/lutron_caseta/__init__.py @@ -227,7 +227,7 @@ def _async_subscribe_pico_remote_events( action = ACTION_RELEASE type_ = device["type"] - name = device["name"] + area, name = device["name"].split("_", 1) button_number = device["button_number"] # The original implementation used LIP instead of LEAP # so we need to convert the button number to maintain compat @@ -252,7 +252,7 @@ def _async_subscribe_pico_remote_events( ATTR_BUTTON_NUMBER: lip_button_number, ATTR_LEAP_BUTTON_NUMBER: button_number, ATTR_DEVICE_NAME: name, - ATTR_AREA_NAME: name.split("_")[0], + ATTR_AREA_NAME: area, ATTR_ACTION: action, }, ) From b450a41d7b321639c2fd034b2cbd8e6d3b26d301 Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Fri, 4 Feb 2022 02:19:36 +0200 Subject: [PATCH 2/2] Fix Shelly Plus i4 KeyError (#65604) --- homeassistant/components/shelly/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/shelly/utils.py b/homeassistant/components/shelly/utils.py index a01b5de133a..7a41c914e8a 100644 --- a/homeassistant/components/shelly/utils.py +++ b/homeassistant/components/shelly/utils.py @@ -264,7 +264,8 @@ def get_model_name(info: dict[str, Any]) -> str: def get_rpc_channel_name(device: RpcDevice, key: str) -> str: """Get name based on device and channel name.""" - key = key.replace("input", "switch") + if device.config.get("switch:0"): + key = key.replace("input", "switch") device_name = get_rpc_device_name(device) entity_name: str | None = device.config[key].get("name", device_name)