Migrate solax away from using async_add_job (#113257)
The plan is to deprecate `async_add_job` to reduce the number of job APIs we have to maintain. See #113179 for additional history. `async_add_job` was not being used as expected herepull/113262/head
parent
9ef0a8cb95
commit
7f37732e71
homeassistant/components/solax
|
@ -103,8 +103,12 @@ async def async_setup_entry(
|
|||
serial = resp.serial_number
|
||||
version = resp.version
|
||||
endpoint = RealTimeDataEndpoint(hass, api)
|
||||
hass.async_add_job(endpoint.async_refresh)
|
||||
async_track_time_interval(hass, endpoint.async_refresh, SCAN_INTERVAL)
|
||||
entry.async_create_background_task(
|
||||
hass, endpoint.async_refresh(), f"solax {entry.title} initial refresh"
|
||||
)
|
||||
entry.async_on_unload(
|
||||
async_track_time_interval(hass, endpoint.async_refresh, SCAN_INTERVAL)
|
||||
)
|
||||
devices = []
|
||||
for sensor, (idx, measurement) in api.inverter.sensor_map().items():
|
||||
description = SENSOR_DESCRIPTIONS[(measurement.unit, measurement.is_monotonic)]
|
||||
|
|
Loading…
Reference in New Issue