Bump Synology DSM to 0.9.0 (#39819)

This commit is contained in:
Quentame 2020-09-08 23:38:41 +02:00 committed by GitHub
parent 748e2696dc
commit 95a33ba894
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 12 deletions

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -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": [
{

View file

@ -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

View file

@ -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