From acb7e24852baa99f38c7314ac342f216e3ef6c05 Mon Sep 17 00:00:00 2001 From: Aidan Timson Date: Sat, 5 Feb 2022 21:56:36 +0000 Subject: [PATCH] Reduce System Bridge load on server (#65794) --- .../components/system_bridge/coordinator.py | 24 +++++++++++-------- .../components/system_bridge/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/homeassistant/components/system_bridge/coordinator.py b/homeassistant/components/system_bridge/coordinator.py index 7610e76b7bb..896309f2593 100644 --- a/homeassistant/components/system_bridge/coordinator.py +++ b/homeassistant/components/system_bridge/coordinator.py @@ -63,16 +63,20 @@ class SystemBridgeDataUpdateCoordinator(DataUpdateCoordinator[Bridge]): await self.bridge.async_send_event( "get-data", [ - "battery", - "cpu", - "display", - "filesystem", - "graphics", - "memory", - "network", - "os", - "processes", - "system", + {"service": "battery", "method": "findAll", "observe": True}, + {"service": "cpu", "method": "findAll", "observe": True}, + {"service": "display", "method": "findAll", "observe": True}, + {"service": "filesystem", "method": "findSizes", "observe": True}, + {"service": "graphics", "method": "findAll", "observe": True}, + {"service": "memory", "method": "findAll", "observe": True}, + {"service": "network", "method": "findAll", "observe": True}, + {"service": "os", "method": "findAll", "observe": False}, + { + "service": "processes", + "method": "findCurrentLoad", + "observe": True, + }, + {"service": "system", "method": "findAll", "observe": False}, ], ) await self.bridge.listen_for_events(callback=self.async_handle_event) diff --git a/homeassistant/components/system_bridge/manifest.json b/homeassistant/components/system_bridge/manifest.json index 31c19e4614f..8fba9dd30cf 100644 --- a/homeassistant/components/system_bridge/manifest.json +++ b/homeassistant/components/system_bridge/manifest.json @@ -3,7 +3,7 @@ "name": "System Bridge", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/system_bridge", - "requirements": ["systembridge==2.2.3"], + "requirements": ["systembridge==2.3.1"], "codeowners": ["@timmo001"], "zeroconf": ["_system-bridge._udp.local."], "after_dependencies": ["zeroconf"], diff --git a/requirements_all.txt b/requirements_all.txt index bfc7f30cfb2..88b2b92409a 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2311,7 +2311,7 @@ swisshydrodata==0.1.0 synology-srm==0.2.0 # homeassistant.components.system_bridge -systembridge==2.2.3 +systembridge==2.3.1 # homeassistant.components.tailscale tailscale==0.2.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index c81f4943114..d9397b88cf0 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1423,7 +1423,7 @@ sunwatcher==0.2.1 surepy==0.7.2 # homeassistant.components.system_bridge -systembridge==2.2.3 +systembridge==2.3.1 # homeassistant.components.tailscale tailscale==0.2.0