Skip to content

Commit

Permalink
fix: relay
Browse files Browse the repository at this point in the history
  • Loading branch information
acesyde committed Feb 16, 2024
1 parent af310bf commit 16f0cb6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion custom_components/mylight_systems/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
NAME = "MyLight Systems"
DOMAIN = "mylight_systems"
PLATFORMS = [Platform.SENSOR, Platform.SWITCH]
VERSION = "0.1.0"
VERSION = "0.1.1"
COORDINATOR = "coordinator"
ATTRIBUTION = "Data provided by https://www.mylight-systems.com/"
SCAN_INTERVAL_IN_MINUTES = 15
Expand Down
12 changes: 6 additions & 6 deletions custom_components/mylight_systems/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ async def _async_update_data(self) -> MyLightSystemsCoordinatorData:
virtual_battery_id = self.config_entry.data[
CONF_VIRTUAL_BATTERY_ID
]
master_relay_id = self.config_entry.data[
CONF_MASTER_RELAY_ID
]
master_relay_id = self.config_entry.data.get(CONF_MASTER_RELAY_ID, None)

await self.authenticate_user(email, password)

Expand All @@ -92,9 +90,11 @@ async def _async_update_data(self) -> MyLightSystemsCoordinatorData:
self.__auth_token, virtual_battery_id
)

master_relay_state = await self.client.async_get_relay_state(
self.__auth_token, master_relay_id
)
master_relay_state = None
if master_relay_id is not None:
master_relay_state = await self.client.async_get_relay_state(
self.__auth_token, master_relay_id
)

data = MyLightSystemsCoordinatorData(
produced_energy=self.find_measure_by_type(
Expand Down
2 changes: 1 addition & 1 deletion custom_components/mylight_systems/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"documentation": "https://github.com/acesyde/hassio_mylight_integration",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/acesyde/hassio_mylight_integration/issues",
"version": "0.1.0"
"version": "0.1.1"
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mylight_systems"
version = "0.1.0"
version = "0.1.1"
description = "MyLight Systems integration for Home Assistant"
authors = ["Pierre-Emmanuel Mercier <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 16f0cb6

Please sign in to comment.