glances_api 0.4.2__tar.gz → 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {glances_api-0.4.2 → glances_api-0.4.3}/PKG-INFO +1 -1
- {glances_api-0.4.2 → glances_api-0.4.3}/glances_api/__init__.py +11 -0
- {glances_api-0.4.2 → glances_api-0.4.3}/pyproject.toml +2 -2
- {glances_api-0.4.2 → glances_api-0.4.3}/LICENSE +0 -0
- {glances_api-0.4.2 → glances_api-0.4.3}/README.rst +0 -0
- {glances_api-0.4.2 → glances_api-0.4.3}/glances_api/exceptions.py +0 -0
|
@@ -135,6 +135,15 @@ class Glances:
|
|
|
135
135
|
}
|
|
136
136
|
if data := self.data.get("quicklook"):
|
|
137
137
|
sensor_data["cpu"] = {"cpu_use_percent": data["cpu"]}
|
|
138
|
+
if networks := self.data.get("network"):
|
|
139
|
+
sensor_data["network"] = {}
|
|
140
|
+
for network in networks:
|
|
141
|
+
sensor_data["network"][network["interface_name"]] = {
|
|
142
|
+
"is_up": network["is_up"],
|
|
143
|
+
"rx": round(network["rx"] / 1024, 1),
|
|
144
|
+
"tx": round(network["tx"] / 1024, 1),
|
|
145
|
+
"speed": round(network["speed"] / 1024**3, 1),
|
|
146
|
+
}
|
|
138
147
|
if "docker" in self.data and (data := self.data["docker"].get("containers")):
|
|
139
148
|
active_containers = [
|
|
140
149
|
container for container in data if container["Status"] == "running"
|
|
@@ -150,4 +159,6 @@ class Glances:
|
|
|
150
159
|
sensor_data["docker"]["docker_memory_use"] = round(mem_use / 1024**2, 1)
|
|
151
160
|
if data := self.data.get("raid"):
|
|
152
161
|
sensor_data["raid"] = data
|
|
162
|
+
if data := self.data.get("uptime"):
|
|
163
|
+
sensor_data["uptime"] = data
|
|
153
164
|
return sensor_data
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "glances_api"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.3"
|
|
4
4
|
description = "Python API for interacting with Glances"
|
|
5
5
|
authors = ["Fabian Affolter <fabian@affolter-engineering.ch>"]
|
|
6
6
|
homepage = "https://github.com/home-assistant-ecosystem/python-glances-api"
|
|
@@ -23,7 +23,7 @@ httpx = ">=0.23,<1"
|
|
|
23
23
|
|
|
24
24
|
[tool.poetry.dev-dependencies]
|
|
25
25
|
black = "^23.3"
|
|
26
|
-
pytest = "^7.
|
|
26
|
+
pytest = "^7.3.0"
|
|
27
27
|
pytest-httpx = ">0.15,<1"
|
|
28
28
|
pytest-asyncio = "^0.16.0"
|
|
29
29
|
isort = "^5.10.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|