diff --git a/homeassistant/components/systemmonitor/sensor.py b/homeassistant/components/systemmonitor/sensor.py index 9097fa81928..35159f27d79 100644 --- a/homeassistant/components/systemmonitor/sensor.py +++ b/homeassistant/components/systemmonitor/sensor.py @@ -626,8 +626,8 @@ async def async_setup_entry( # noqa: C901 ) ) - for _arg in coordinator.data.fan_rpm: - if _type == "fan_rpm": + if _type == "fan_rpm": + for _arg in coordinator.data.fan_rpm: argument = "" loaded_resources.add(slugify(f"{_type}_{argument}")) entities.append( diff --git a/tests/components/systemmonitor/snapshots/test_sensor.ambr b/tests/components/systemmonitor/snapshots/test_sensor.ambr index eeaddbacb7c..7fb76663bb5 100644 --- a/tests/components/systemmonitor/snapshots/test_sensor.ambr +++ b/tests/components/systemmonitor/snapshots/test_sensor.ambr @@ -10,6 +10,17 @@ # name: test_sensor[System Monitor Battery - state] '93' # --- +# name: test_sensor[System Monitor Battery remaining - attributes] + ReadOnlyDict({ + 'device_class': 'duration', + 'friendly_name': 'System Monitor Battery remaining', + 'state_class': , + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[System Monitor Battery remaining - state] + '277.133333333333' +# --- # name: test_sensor[System Monitor Disk free / - attributes] ReadOnlyDict({ 'device_class': 'data_size', @@ -84,17 +95,6 @@ # name: test_sensor[System Monitor Disk use /media/share - state] '300.0' # --- -# name: test_sensor[System Monitor Duration - attributes] - ReadOnlyDict({ - 'device_class': 'duration', - 'friendly_name': 'System Monitor Duration', - 'state_class': , - 'unit_of_measurement': , - }) -# --- -# name: test_sensor[System Monitor Duration - state] - '277.133333333333' -# --- # name: test_sensor[System Monitor IPv4 address eth0 - attributes] ReadOnlyDict({ 'friendly_name': 'System Monitor IPv4 address eth0',