mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Solax update 0.1.0 (#24708)
* Update to solax 0.0.6 * Library version 0.1.0
This commit is contained in:
parent
128e66fa24
commit
57502bc911
@ -3,7 +3,7 @@
|
|||||||
"name": "Solax Inverter",
|
"name": "Solax Inverter",
|
||||||
"documentation": "https://www.home-assistant.io/components/solax",
|
"documentation": "https://www.home-assistant.io/components/solax",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"solax==0.0.3"
|
"solax==0.1.0"
|
||||||
],
|
],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": ["@squishykid"]
|
"codeowners": ["@squishykid"]
|
||||||
|
@ -30,7 +30,7 @@ async def async_setup_platform(hass, config, async_add_entities,
|
|||||||
"""Platform setup."""
|
"""Platform setup."""
|
||||||
import solax
|
import solax
|
||||||
|
|
||||||
api = solax.solax.RealTimeAPI(config[CONF_IP_ADDRESS])
|
api = solax.RealTimeAPI(config[CONF_IP_ADDRESS])
|
||||||
endpoint = RealTimeDataEndpoint(hass, api)
|
endpoint = RealTimeDataEndpoint(hass, api)
|
||||||
hass.async_add_job(endpoint.async_refresh)
|
hass.async_add_job(endpoint.async_refresh)
|
||||||
async_track_time_interval(hass, endpoint.async_refresh, SCAN_INTERVAL)
|
async_track_time_interval(hass, endpoint.async_refresh, SCAN_INTERVAL)
|
||||||
@ -51,7 +51,6 @@ class RealTimeDataEndpoint:
|
|||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
self.api = api
|
self.api = api
|
||||||
self.data = {}
|
|
||||||
self.ready = asyncio.Event()
|
self.ready = asyncio.Event()
|
||||||
self.sensors = []
|
self.sensors = []
|
||||||
|
|
||||||
@ -63,16 +62,17 @@ class RealTimeDataEndpoint:
|
|||||||
from solax import SolaxRequestError
|
from solax import SolaxRequestError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.data = await self.api.get_data()
|
api_response = await self.api.get_data()
|
||||||
self.ready.set()
|
self.ready.set()
|
||||||
except SolaxRequestError:
|
except SolaxRequestError:
|
||||||
if now is not None:
|
if now is not None:
|
||||||
self.ready.clear()
|
self.ready.clear()
|
||||||
else:
|
else:
|
||||||
raise PlatformNotReady
|
raise PlatformNotReady
|
||||||
|
data = api_response.data
|
||||||
for sensor in self.sensors:
|
for sensor in self.sensors:
|
||||||
if sensor.key in self.data:
|
if sensor.key in data:
|
||||||
sensor.value = self.data[sensor.key]
|
sensor.value = data[sensor.key]
|
||||||
sensor.async_schedule_update_ha_state()
|
sensor.async_schedule_update_ha_state()
|
||||||
|
|
||||||
|
|
||||||
|
@ -1702,7 +1702,7 @@ solaredge-local==0.1.4
|
|||||||
solaredge==0.0.2
|
solaredge==0.0.2
|
||||||
|
|
||||||
# homeassistant.components.solax
|
# homeassistant.components.solax
|
||||||
solax==0.0.3
|
solax==0.1.0
|
||||||
|
|
||||||
# homeassistant.components.honeywell
|
# homeassistant.components.honeywell
|
||||||
somecomfort==0.5.2
|
somecomfort==0.5.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user