From 8faec3da8d4ebbac431f9c2fb65807a2013c4aaf Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 30 Aug 2021 12:06:24 +0200 Subject: [PATCH] Correct setup of system_bridge sensors (#55442) --- homeassistant/components/system_bridge/sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/system_bridge/sensor.py b/homeassistant/components/system_bridge/sensor.py index 18227e60800..720bfc78a72 100644 --- a/homeassistant/components/system_bridge/sensor.py +++ b/homeassistant/components/system_bridge/sensor.py @@ -376,7 +376,7 @@ async def async_setup_entry( state_class=STATE_CLASS_MEASUREMENT, native_unit_of_measurement=PERCENTAGE, icon="mdi:percent", - value=lambda bridge: round( + value=lambda bridge, index=index: round( bridge.processes.load.cpus[index].load, 2 ), ), @@ -390,7 +390,7 @@ async def async_setup_entry( state_class=STATE_CLASS_MEASUREMENT, native_unit_of_measurement=PERCENTAGE, icon="mdi:percent", - value=lambda bridge: round( + value=lambda bridge, index=index: round( bridge.processes.load.cpus[index].loadIdle, 2 ), ), @@ -404,7 +404,7 @@ async def async_setup_entry( state_class=STATE_CLASS_MEASUREMENT, native_unit_of_measurement=PERCENTAGE, icon="mdi:percent", - value=lambda bridge: round( + value=lambda bridge, index=index: round( bridge.processes.load.cpus[index].loadSystem, 2 ), ), @@ -418,7 +418,7 @@ async def async_setup_entry( state_class=STATE_CLASS_MEASUREMENT, native_unit_of_measurement=PERCENTAGE, icon="mdi:percent", - value=lambda bridge: round( + value=lambda bridge, index=index: round( bridge.processes.load.cpus[index].loadUser, 2 ), ),