From f46055de994396a31c000eb0340da213d35a0e6e Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Thu, 2 Dec 2021 19:26:00 +0200 Subject: [PATCH] Fix Shelly device name for older firmware (#60826) --- homeassistant/components/shelly/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/shelly/utils.py b/homeassistant/components/shelly/utils.py index d5fcf154e28..a77f338a51e 100644 --- a/homeassistant/components/shelly/utils.py +++ b/homeassistant/components/shelly/utils.py @@ -57,7 +57,7 @@ def get_block_device_name(device: BlockDevice) -> str: def get_rpc_device_name(device: RpcDevice) -> str: """Naming for device.""" - return cast(str, device.config["sys"]["device"]["name"] or device.hostname) + return cast(str, device.config["sys"]["device"].get("name") or device.hostname) def get_number_of_channels(device: BlockDevice, block: Block) -> int: