mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Correct setup of system_bridge sensors (#55442)
This commit is contained in:
parent
1060630bbd
commit
8faec3da8d
@ -376,7 +376,7 @@ async def async_setup_entry(
|
|||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
icon="mdi:percent",
|
icon="mdi:percent",
|
||||||
value=lambda bridge: round(
|
value=lambda bridge, index=index: round(
|
||||||
bridge.processes.load.cpus[index].load, 2
|
bridge.processes.load.cpus[index].load, 2
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -390,7 +390,7 @@ async def async_setup_entry(
|
|||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
icon="mdi:percent",
|
icon="mdi:percent",
|
||||||
value=lambda bridge: round(
|
value=lambda bridge, index=index: round(
|
||||||
bridge.processes.load.cpus[index].loadIdle, 2
|
bridge.processes.load.cpus[index].loadIdle, 2
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -404,7 +404,7 @@ async def async_setup_entry(
|
|||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
icon="mdi:percent",
|
icon="mdi:percent",
|
||||||
value=lambda bridge: round(
|
value=lambda bridge, index=index: round(
|
||||||
bridge.processes.load.cpus[index].loadSystem, 2
|
bridge.processes.load.cpus[index].loadSystem, 2
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -418,7 +418,7 @@ async def async_setup_entry(
|
|||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=STATE_CLASS_MEASUREMENT,
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
icon="mdi:percent",
|
icon="mdi:percent",
|
||||||
value=lambda bridge: round(
|
value=lambda bridge, index=index: round(
|
||||||
bridge.processes.load.cpus[index].loadUser, 2
|
bridge.processes.load.cpus[index].loadUser, 2
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user