diff --git a/custom_components/govee/__init__.py b/custom_components/govee/__init__.py index 200cfc4..98799c8 100644 --- a/custom_components/govee/__init__.py +++ b/custom_components/govee/__init__.py @@ -70,7 +70,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): for component in PLATFORMS: hass.async_create_task( - hass.config_entries.async_forward_entry_setup(entry, component) + hass.config_entries.async_forward_entry_setups(entry, [component]) ) return True diff --git a/custom_components/govee/learning_storage.py b/custom_components/govee/learning_storage.py index f33ce3a..cf19bc1 100644 --- a/custom_components/govee/learning_storage.py +++ b/custom_components/govee/learning_storage.py @@ -3,7 +3,6 @@ from dataclasses import asdict import logging -import dacite from govee_api_laggat import GoveeAbstractLearningStorage, GoveeLearnedInfo import yaml @@ -26,12 +25,12 @@ async def read(self): learned_info = {} try: learned_dict = load_yaml(self._config_dir + LEARNING_STORAGE_YAML) - learned_info = { - device: dacite.from_dict( - data_class=GoveeLearnedInfo, data=learned_dict[device] - ) - for device in learned_dict - } + + for key, value in learned_dict.items(): + learnedInfoItem = GoveeLearnedInfo() + learnedInfoItem.__dict__.update(**value) + learned_info[key] = learnedInfoItem + _LOGGER.info( "Loaded learning information from %s.", self._config_dir + LEARNING_STORAGE_YAML, @@ -43,7 +42,6 @@ async def read(self): self._config_dir + LEARNING_STORAGE_YAML, ) except ( - dacite.DaciteError, TypeError, UnicodeDecodeError, yaml.YAMLError, diff --git a/custom_components/govee/manifest.json b/custom_components/govee/manifest.json index 363300b..6f16015 100644 --- a/custom_components/govee/manifest.json +++ b/custom_components/govee/manifest.json @@ -8,7 +8,7 @@ "homekit": {}, "iot_class": "cloud_polling", "issue_tracker": "https://github.com/LaggAt/hacs-govee/issues", - "requirements": ["govee-api-laggat==0.2.2", "dacite==1.8.0"], + "requirements": ["govee-api-laggat==0.2.2"], "ssdp": [], "version": "2023.11.1", "zeroconf": []