Correct setup of system_bridge sensors (#55442)
This commit is contained in:
parent
1060630bbd
commit
8faec3da8d
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue