Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023.6.3 #95119

Merged
merged 27 commits into from
Jun 23, 2023
Merged

2023.6.3 #95119

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3f93699
Register Fully Kiosk services regardless of setup result (#88647)
mheath Jun 19, 2023
bd0b8dc
Fortios device tracker updates (#92331)
kimfrellsen Jun 15, 2023
d2385f9
Handle LastFM unavailable (#94456)
joostlek Jun 23, 2023
ffe35c7
Handle Insteon events correctly (#94549)
teharris1 Jun 16, 2023
78bbec0
Fix unit for Habitica text sensors (#94550)
atudor2 Jun 16, 2023
e1c486f
Bump minimum typing_extensions to 4.6.3 (#94587)
Jun 15, 2023
203820d
Fix glances raid plugin data (#94597)
Jun 23, 2023
57dd62e
Make YouTube select lower quality thumbnails (#94652)
joostlek Jun 18, 2023
6329f6b
Add strings for YouTube reauthentication (#94655)
joostlek Jun 16, 2023
b52cfd3
Fix bluetooth tracker asyncio usage (#94695)
d03n3rfr1tz3 Jun 16, 2023
89c6494
Fix zwave_js trigger event reattach logic (#94702)
raman325 Jun 16, 2023
254b1fd
Fix warning from rapt_ble caused by payload version 2 (#94718)
sairon Jun 16, 2023
f33d671
Fix Totalconnect BinarySensorDeviceClass logic (#94772)
austinmroczek Jun 20, 2023
e175164
Bump HAP-python to 4.7.0 (#94812)
bdraco Jun 20, 2023
cee8004
Bump bthome to 2.12.0 (#94822)
Ernst79 Jun 18, 2023
5da5522
Update aioairzone to v0.6.4 (#94873)
Noltari Jun 20, 2023
f8cfaa6
Bump ical to 4.5.4 (#94894)
allenporter Jun 20, 2023
34ef89b
Fix Meteo France blocked config entry when weather alert API fails (#…
Quentame Jun 22, 2023
cda784c
Add error handling to hassio issues (#94951)
epenet Jun 21, 2023
bbbc9f6
Bump Matter Server to 3.5.1: some small fixes and stability improveme…
marcelveldt Jun 21, 2023
44e7243
Fix zwave_js device diagnostics dump (#94999)
raman325 Jun 22, 2023
ced6968
Bump bimmer_connected to 0.13.7 (#95017)
rikroe Jun 21, 2023
e26b8e1
Fix goodwe midnight error (#95041)
hmmbob Jun 22, 2023
0fa9540
Fix removal of orphaned Matter devices (#95044)
marcelveldt Jun 22, 2023
8f9425f
Fix KNX device trigger passing info data (#95076)
farmio Jun 22, 2023
4cf9bec
Bumped version to 2023.6.3
frenck Jun 23, 2023
9f6dab0
Remove incompatible config schema for Fully Kiosk
frenck Jun 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix glances raid plugin data (#94597)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
  • Loading branch information
2 people authored and frenck committed Jun 23, 2023
commit 203820d836094b9f378b03329ad8ab84df6b4880
52 changes: 26 additions & 26 deletions homeassistant/components/glances/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,17 @@ class GlancesSensorEntityDescription(
icon="mdi:docker",
state_class=SensorStateClass.MEASUREMENT,
),
("raid", "used"): GlancesSensorEntityDescription(
key="used",
("raid", "available"): GlancesSensorEntityDescription(
key="available",
type="raid",
name_suffix="Raid used",
name_suffix="Raid available",
icon="mdi:harddisk",
state_class=SensorStateClass.MEASUREMENT,
),
("raid", "available"): GlancesSensorEntityDescription(
key="available",
("raid", "used"): GlancesSensorEntityDescription(
key="used",
type="raid",
name_suffix="Raid available",
name_suffix="Raid used",
icon="mdi:harddisk",
state_class=SensorStateClass.MEASUREMENT,
),
Expand Down Expand Up @@ -269,36 +269,36 @@ def _migrate_old_unique_ids(
if sensor_type in ["fs", "sensors", "raid"]:
for sensor_label, params in sensors.items():
for param in params:
sensor_description = SENSOR_TYPES[(sensor_type, param)]
if sensor_description := SENSOR_TYPES.get((sensor_type, param)):
_migrate_old_unique_ids(
hass,
f"{coordinator.host}-{name} {sensor_label} {sensor_description.name_suffix}",
f"{sensor_label}-{sensor_description.key}",
)
entities.append(
GlancesSensor(
coordinator,
name,
sensor_label,
sensor_description,
)
)
else:
for sensor in sensors:
if sensor_description := SENSOR_TYPES.get((sensor_type, sensor)):
_migrate_old_unique_ids(
hass,
f"{coordinator.host}-{name} {sensor_label} {sensor_description.name_suffix}",
f"{sensor_label}-{sensor_description.key}",
f"{coordinator.host}-{name} {sensor_description.name_suffix}",
f"-{sensor_description.key}",
)
entities.append(
GlancesSensor(
coordinator,
name,
sensor_label,
"",
sensor_description,
)
)
else:
for sensor in sensors:
sensor_description = SENSOR_TYPES[(sensor_type, sensor)]
_migrate_old_unique_ids(
hass,
f"{coordinator.host}-{name} {sensor_description.name_suffix}",
f"-{sensor_description.key}",
)
entities.append(
GlancesSensor(
coordinator,
name,
"",
sensor_description,
)
)

async_add_entities(entities)

Expand Down
52 changes: 52 additions & 0 deletions tests/components/glances/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,40 @@
"os_version": "5.15.6-200.fc35.x86_64",
"hr_name": "Fedora Linux 35 64bit",
},
"raid": {
"md3": {
"status": "active",
"type": "raid1",
"components": {"sdh1": "2", "sdi1": "0"},
"available": "2",
"used": "2",
"config": "UU",
},
"md1": {
"status": "active",
"type": "raid1",
"components": {"sdg": "0", "sde": "1"},
"available": "2",
"used": "2",
"config": "UU",
},
"md4": {
"status": "active",
"type": "raid1",
"components": {"sdf1": "1", "sdb1": "0"},
"available": "2",
"used": "2",
"config": "UU",
},
"md0": {
"status": "active",
"type": "raid1",
"components": {"sdc": "2", "sdd": "3"},
"available": "2",
"used": "2",
"config": "UU",
},
},
"uptime": "3 days, 10:25:20",
}

Expand All @@ -156,4 +190,22 @@
"memory_free": 2745.0,
},
"docker": {"docker_active": 2, "docker_cpu_use": 77.2, "docker_memory_use": 1149.6},
"raid": {
"md3": {
"status": "active",
"type": "raid1",
"components": {"sdh1": "2", "sdi1": "0"},
"available": "2",
"used": "2",
"config": "UU",
},
"md1": {
"status": "active",
"type": "raid1",
"components": {"sdg": "0", "sde": "1"},
"available": "2",
"used": "2",
"config": "UU",
},
},
}
8 changes: 8 additions & 0 deletions tests/components/glances/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ async def test_sensor_states(hass: HomeAssistant) -> None:
assert state.state == HA_SENSOR_DATA["docker"]["docker_cpu_use"]
if state := hass.states.get("sensor.0_0_0_0_docker_memory_use"):
assert state.state == HA_SENSOR_DATA["docker"]["docker_memory_use"]
if state := hass.states.get("sensor.0_0_0_0_md3_available"):
assert state.state == HA_SENSOR_DATA["raid"]["md3"]["available"]
if state := hass.states.get("sensor.0_0_0_0_md3_used"):
assert state.state == HA_SENSOR_DATA["raid"]["md3"]["used"]
if state := hass.states.get("sensor.0_0_0_0_md1_available"):
assert state.state == HA_SENSOR_DATA["raid"]["md1"]["available"]
if state := hass.states.get("sensor.0_0_0_0_md1_used"):
assert state.state == HA_SENSOR_DATA["raid"]["md1"]["used"]


@pytest.mark.parametrize(
Expand Down