Skip to content

Commit

Permalink
Fix sensor failed when device offline
Browse files Browse the repository at this point in the history
  • Loading branch information
JyunWei-Su committed Aug 22, 2024
1 parent 191da3d commit 82ea84a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/panasonic_smart_app/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def async_setup_entry(hass, entry, async_add_entities) -> bool:

for index, device in enumerate(devices):
device_type = int(device.get("DeviceType"))
device_status = coordinator.data[index]["status"].keys()
device_status = coordinator.data[index].get("status", {}).keys()
_LOGGER.debug(f"Device index #{index} status: {device_status}")

sensors.append(
Expand Down

0 comments on commit 82ea84a

Please sign in to comment.