mirror of
https://github.com/ProtoThis/python-synology.git
synced 2026-01-19 09:28:42 +00:00
Fixed various styling issues 4.0
This commit is contained in:
@ -110,19 +110,25 @@ class SynoUtilization(object):
|
||||
return SynoFormatHelper.bytesToReadable(
|
||||
int(self._data["memory"]["total_swap"]) * 1024)
|
||||
|
||||
def _get_network(self, network_id):
|
||||
if self._data is not None:
|
||||
for network in self._data["network"]:
|
||||
if network["device"] == network_id:
|
||||
return network
|
||||
|
||||
@property
|
||||
def network_up(self):
|
||||
#TODO: Check if we are looking at the total network interface (not eth0 or eth1 for example)
|
||||
if self._data is not None:
|
||||
network = self._get_network("total")
|
||||
if network is not None:
|
||||
return SynoFormatHelper.bytesToReadable(
|
||||
int(self._data["network"][0]["tx"]))
|
||||
int(network["tx"]))
|
||||
|
||||
@property
|
||||
def network_down(self):
|
||||
#TODO: Check if we are looking at the total network interface (not eth0 or eth1 for example)
|
||||
if self._data is not None:
|
||||
network = self._get_network("total")
|
||||
if network is not None:
|
||||
return SynoFormatHelper.bytesToReadable(
|
||||
int(self._data["network"][0]["rx"]))
|
||||
int(network["rx"]))
|
||||
|
||||
|
||||
class SynoStorage(object):
|
||||
@ -288,5 +294,4 @@ class SynologyApi(object):
|
||||
api,
|
||||
self.access_token)
|
||||
self._storage = SynoStorage(self._getUrl(url))
|
||||
print(url)
|
||||
return self._storage
|
||||
|
||||
Reference in New Issue
Block a user