diff --git a/custom_components/mylight_systems/const.py b/custom_components/mylight_systems/const.py index efab179..480dff8 100644 --- a/custom_components/mylight_systems/const.py +++ b/custom_components/mylight_systems/const.py @@ -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 diff --git a/custom_components/mylight_systems/coordinator.py b/custom_components/mylight_systems/coordinator.py index cb11c28..07a7709 100644 --- a/custom_components/mylight_systems/coordinator.py +++ b/custom_components/mylight_systems/coordinator.py @@ -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) @@ -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( diff --git a/custom_components/mylight_systems/manifest.json b/custom_components/mylight_systems/manifest.json index f4908dc..1e3f29c 100644 --- a/custom_components/mylight_systems/manifest.json +++ b/custom_components/mylight_systems/manifest.json @@ -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" } diff --git a/pyproject.toml b/pyproject.toml index 93cff29..23934b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] license = "MIT"