Skip to content

Commit

Permalink
Don't crash if we failed to retrive config
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronen Gruengras committed Apr 21, 2024
1 parent c0a21cc commit d451802
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions custom_components/hass_nuki_bt/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def __init__(self, coordinator: NukiDataUpdateCoordinator) -> None:
model=coordinator.device.device_type,
name=coordinator.device_name,
hw_version=".".join(
str(x) for x in coordinator.device.config["hardware_revision"]
str(x) for x in coordinator.device.config.get("hardware_revision",[])
),
sw_version=".".join(
str(x) for x in coordinator.device.config["firmware_version"]
str(x) for x in coordinator.device.config.get("firmware_version",[])
),
)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/hass_nuki_bt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class NukiSensorEntityDescription(SensorEntityDescription):
icon="mdi:lock",
device_class=SensorDeviceClass.ENUM,
entity_category=EntityCategory.DIAGNOSTIC,
info_function=lambda slf: slf.device.config[slf.sensor],
info_function=lambda slf: slf.device.config.get(slf.sensor),
),
"rssi": NukiSensorEntityDescription(
key="rssi",
Expand Down

0 comments on commit d451802

Please sign in to comment.