Skip to content

Commit

Permalink
Solax update 0.1.0 (home-assistant#24708)
Browse files Browse the repository at this point in the history
* Update to solax 0.0.6

* Library version 0.1.0
  • Loading branch information
squishykid authored and Danielhiversen committed Jun 23, 2019
1 parent 128e66f commit 57502bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/solax/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
10 changes: 5 additions & 5 deletions homeassistant/components/solax/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -51,7 +51,6 @@ def __init__(self, hass, api):
"""Initialize the sensor."""
self.hass = hass
self.api = api
self.data = {}
self.ready = asyncio.Event()
self.sensors = []

Expand All @@ -63,16 +62,17 @@ async def async_refresh(self, now=None):
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()


Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 57502bc

Please sign in to comment.