Files
synology-api-python/src/synology_dsm/api/core/upgrade.py
Oncleben31 4132155ab8 Move python file in src folder (#77)
Preparation of migration to cookiecutter-hypermodern-python template
2020-10-20 00:31:59 +02:00

24 lines
613 B
Python

"""DSM Upgrade data and actions."""
class SynoCoreUpgrade:
"""Class containing upgrade data and actions."""
API_KEY = "SYNO.Core.Upgrade"
API_SERVER_KEY = API_KEY + ".Server"
def __init__(self, dsm):
self._dsm = dsm
self._data = {}
def update(self):
"""Updates Upgrade data."""
raw_data = self._dsm.get(self.API_SERVER_KEY, "check")
if raw_data:
self._data = raw_data["data"]
@property
def update_available(self):
"""Gets all Upgrade info."""
return self._data["update"].get("available")