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 changed files with 7 additions and 7 deletions
|
@ -3,7 +3,7 @@
|
|||
"name": "Solax Inverter",
|
||||
"documentation": "https://www.home-assistant.io/components/solax",
|
||||
"requirements": [
|
||||
"solax==0.0.3"
|
||||
"solax==0.1.0"
|
||||
],
|
||||
"dependencies": [],
|
||||
"codeowners": ["@squishykid"]
|
||||
|
|
|
@ -30,7 +30,7 @@ async def async_setup_platform(hass, config, async_add_entities,
|
|||
"""Platform setup."""
|
||||
import solax
|
||||
|
||||
api = solax.solax.RealTimeAPI(config[CONF_IP_ADDRESS])
|
||||
api = solax.RealTimeAPI(config[CONF_IP_ADDRESS])
|
||||
endpoint = RealTimeDataEndpoint(hass, api)
|
||||
hass.async_add_job(endpoint.async_refresh)
|
||||
async_track_time_interval(hass, endpoint.async_refresh, SCAN_INTERVAL)
|
||||
|
@ -51,7 +51,6 @@ class RealTimeDataEndpoint:
|
|||
"""Initialize the sensor."""
|
||||
self.hass = hass
|
||||
self.api = api
|
||||
self.data = {}
|
||||
self.ready = asyncio.Event()
|
||||
self.sensors = []
|
||||
|
||||
|
@ -63,16 +62,17 @@ class RealTimeDataEndpoint:
|
|||
from solax import SolaxRequestError
|
||||
|
||||
try:
|
||||
self.data = await self.api.get_data()
|
||||
api_response = await self.api.get_data()
|
||||
self.ready.set()
|
||||
except SolaxRequestError:
|
||||
if now is not None:
|
||||
self.ready.clear()
|
||||
else:
|
||||
raise PlatformNotReady
|
||||
data = api_response.data
|
||||
for sensor in self.sensors:
|
||||
if sensor.key in self.data:
|
||||
sensor.value = self.data[sensor.key]
|
||||
if sensor.key in data:
|
||||
sensor.value = data[sensor.key]
|
||||
sensor.async_schedule_update_ha_state()
|
||||
|
||||
|
||||
|
|
|
@ -1702,7 +1702,7 @@ solaredge-local==0.1.4
|
|||
solaredge==0.0.2
|
||||
|
||||
# homeassistant.components.solax
|
||||
solax==0.0.3
|
||||
solax==0.1.0
|
||||
|
||||
# homeassistant.components.honeywell
|
||||
somecomfort==0.5.2
|
||||
|
|
Loading…
Add table
Reference in a new issue