Fix Shelly device name for older firmware (#60826)

This commit is contained in:
Shay Levy 2021-12-02 19:26:00 +02:00 committed by GitHub
parent e56a676fd5
commit f46055de99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: