mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Update SMA solar sensor to work with the new add_devices callback (#6602)
This commit is contained in:
parent
f450c1351c
commit
134b3d2f3b
@ -60,7 +60,8 @@ PLATFORM_SCHEMA = vol.All(PLATFORM_SCHEMA.extend({
|
|||||||
}, extra=vol.PREVENT_EXTRA), _check_sensor_schema)
|
}, extra=vol.PREVENT_EXTRA), _check_sensor_schema)
|
||||||
|
|
||||||
|
|
||||||
def async_setup_platform(hass, config, add_devices, discovery_info=None):
|
@asyncio.coroutine
|
||||||
|
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
"""Set up SMA WebConnect sensor."""
|
"""Set up SMA WebConnect sensor."""
|
||||||
import pysma
|
import pysma
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ def async_setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
sensor_defs = {name: val for name, val in sensor_defs.items()
|
sensor_defs = {name: val for name, val in sensor_defs.items()
|
||||||
if name in used_sensors}
|
if name in used_sensors}
|
||||||
|
|
||||||
yield from add_devices(hass_sensors)
|
async_add_devices(hass_sensors)
|
||||||
|
|
||||||
# Init the SMA interface
|
# Init the SMA interface
|
||||||
session = async_get_clientsession(hass)
|
session = async_get_clientsession(hass)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user