mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Renamed device to resource
This commit is contained in:
parent
19964e914a
commit
97258747c7
@ -105,7 +105,7 @@ automation 2:
|
|||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
platform: systemmonitor
|
platform: systemmonitor
|
||||||
devices:
|
resources:
|
||||||
- {type: 'disk_use_percent', arg: '/'}
|
- {type: 'disk_use_percent', arg: '/'}
|
||||||
- {type: 'disk_use_percent', arg: '/home'}
|
- {type: 'disk_use_percent', arg: '/home'}
|
||||||
- {type: 'disk_use', arg: '/home'}
|
- {type: 'disk_use', arg: '/home'}
|
||||||
|
@ -29,13 +29,13 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
""" Sets up the sensors """
|
""" Sets up the sensors """
|
||||||
|
|
||||||
devices = []
|
devices = []
|
||||||
for device in config['devices']:
|
for resurce in config['resources']:
|
||||||
if 'arg' not in device:
|
if 'arg' not in resurce:
|
||||||
device['arg'] = ''
|
resurce['arg'] = ''
|
||||||
if device['type'] not in sensor_types:
|
if resurce['type'] not in sensor_types:
|
||||||
_LOGGER.error('Sensor type: "%s" does not exist', device['type'])
|
_LOGGER.error('Sensor type: "%s" does not exist', resurce['type'])
|
||||||
else:
|
else:
|
||||||
devices.append(SystemMonitorSensor(device['type'], device['arg']))
|
devices.append(SystemMonitorSensor(resurce['type'], resurce['arg']))
|
||||||
|
|
||||||
add_devices(devices)
|
add_devices(devices)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user