mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
Add support container status for Glances on RPi3 (#14529)
* Add support container status for Glances on RPi3 Glances on RPi3 return different container status. ``` "containers": [ { "Status": "Up 2 hours", "name": "HASS", "io": { "iow": 0, "time_since_update": 5.1789350509643555, "cumulative_ior": 94208, "ior": 0, "cumulative_iow": 4096 }, ``` This small PR adds support dealing with this differences. * Making line shorter * Fixing indentation * Fix lint error * Fix ident * Fix intend
This commit is contained in:
parent
2cd127921a
commit
6e5c541a00
@ -161,7 +161,8 @@ class GlancesSensor(Entity):
|
|||||||
elif self.type == 'docker_active':
|
elif self.type == 'docker_active':
|
||||||
count = 0
|
count = 0
|
||||||
for container in value['docker']['containers']:
|
for container in value['docker']['containers']:
|
||||||
if container['Status'] == 'running':
|
if container['Status'] == 'running' or \
|
||||||
|
'Up' in container['Status']:
|
||||||
count += 1
|
count += 1
|
||||||
self._state = count
|
self._state = count
|
||||||
elif self.type == 'docker_cpu_use':
|
elif self.type == 'docker_cpu_use':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user