diff --git a/CODEOWNERS b/CODEOWNERS index 70d89c5e45e..d186ff45cbb 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -420,7 +420,7 @@ homeassistant/components/switchbot/* @danielhiversen homeassistant/components/switcher_kis/* @tomerfi homeassistant/components/switchmate/* @danielhiversen homeassistant/components/syncthru/* @nielstron -homeassistant/components/synology_dsm/* @ProtoThis @Quentame +homeassistant/components/synology_dsm/* @hacf-fr @Quentame homeassistant/components/synology_srm/* @aerialls homeassistant/components/syslog/* @fabaff homeassistant/components/tado/* @michaelarnauts @bdraco diff --git a/homeassistant/components/synology_dsm/__init__.py b/homeassistant/components/synology_dsm/__init__.py index 2e4b550337b..7e229ef4a5b 100644 --- a/homeassistant/components/synology_dsm/__init__.py +++ b/homeassistant/components/synology_dsm/__init__.py @@ -311,7 +311,9 @@ class SynoApi: def _fetch_device_configuration(self): """Fetch initial device config.""" self.information = self.dsm.information + self.information.update() self.network = self.dsm.network + self.network.update() if self._with_security: self.security = self.dsm.security @@ -444,7 +446,7 @@ class SynologyDSMDeviceEntity(SynologyDSMEntity): self._device_type = None if "volume" in entity_type: - volume = self._api.storage._get_volume(self._device_id) + volume = self._api.storage.get_volume(self._device_id) # Volume does not have a name self._device_name = volume["id"].replace("_", " ").capitalize() self._device_manufacturer = "Synology" @@ -457,7 +459,7 @@ class SynologyDSMDeviceEntity(SynologyDSMEntity): .replace("shr", "SHR") ) elif "disk" in entity_type: - disk = self._api.storage._get_disk(self._device_id) + disk = self._api.storage.get_disk(self._device_id) self._device_name = disk["name"] self._device_manufacturer = disk["vendor"] self._device_model = disk["model"].strip() diff --git a/homeassistant/components/synology_dsm/config_flow.py b/homeassistant/components/synology_dsm/config_flow.py index a4d7d75e073..a9df6f362cc 100644 --- a/homeassistant/components/synology_dsm/config_flow.py +++ b/homeassistant/components/synology_dsm/config_flow.py @@ -260,14 +260,15 @@ def _login_and_fetch_syno_info(api, otp_code): """Login to the NAS and fetch basic data.""" # These do i/o api.login(otp_code) - utilisation = api.utilisation - storage = api.storage + api.utilisation.update() + api.storage.update() + api.network.update() if ( not api.information.serial - or utilisation.cpu_user_load is None - or not storage.disks_ids - or not storage.volumes_ids + or api.utilisation.cpu_user_load is None + or not api.storage.disks_ids + or not api.storage.volumes_ids or not api.network.macs ): raise InvalidData diff --git a/homeassistant/components/synology_dsm/manifest.json b/homeassistant/components/synology_dsm/manifest.json index 6ad926cfb9e..aee8c464464 100644 --- a/homeassistant/components/synology_dsm/manifest.json +++ b/homeassistant/components/synology_dsm/manifest.json @@ -2,8 +2,8 @@ "domain": "synology_dsm", "name": "Synology DSM", "documentation": "https://www.home-assistant.io/integrations/synology_dsm", - "requirements": ["python-synology==0.8.2"], - "codeowners": ["@ProtoThis", "@Quentame"], + "requirements": ["python-synology==0.9.0"], + "codeowners": ["@hacf-fr", "@Quentame"], "config_flow": true, "ssdp": [ { diff --git a/requirements_all.txt b/requirements_all.txt index 22688907370..a24f9c66737 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1761,7 +1761,7 @@ python-sochain-api==0.0.2 python-songpal==0.12 # homeassistant.components.synology_dsm -python-synology==0.8.2 +python-synology==0.9.0 # homeassistant.components.tado python-tado==0.8.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index b3b94a5c1da..21e2b2f82c4 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -830,7 +830,7 @@ python-openzwave-mqtt==1.0.5 python-songpal==0.12 # homeassistant.components.synology_dsm -python-synology==0.8.2 +python-synology==0.9.0 # homeassistant.components.tado python-tado==0.8.1