mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Added error checking (#29041)
Add in error checking in case disks or volumes are empty.
This commit is contained in:
parent
752a4d7221
commit
63f66785ad
@ -119,6 +119,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||||||
]
|
]
|
||||||
|
|
||||||
# Handle all volumes
|
# Handle all volumes
|
||||||
|
if api.storage.volumes is not None:
|
||||||
for volume in config.get(CONF_VOLUMES, api.storage.volumes):
|
for volume in config.get(CONF_VOLUMES, api.storage.volumes):
|
||||||
sensors += [
|
sensors += [
|
||||||
SynoNasStorageSensor(
|
SynoNasStorageSensor(
|
||||||
@ -129,6 +130,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||||||
]
|
]
|
||||||
|
|
||||||
# Handle all disks
|
# Handle all disks
|
||||||
|
if api.storage.disks is not None:
|
||||||
for disk in config.get(CONF_DISKS, api.storage.disks):
|
for disk in config.get(CONF_DISKS, api.storage.disks):
|
||||||
sensors += [
|
sensors += [
|
||||||
SynoNasStorageSensor(
|
SynoNasStorageSensor(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user