Overhaul UniFi Protect NVR Disk sensors (#73197)

* Overhauls NVR Disk sensors

* Updates from latest version of pyunifiprotect
This commit is contained in:
Christopher Bailey
2022-06-08 14:13:56 -10:00
committed by GitHub
parent 5c49d0a761
commit 004ff8fb30
3 changed files with 187 additions and 22 deletions
@@ -117,6 +117,158 @@
}
]
},
"ustorage": {
"disks": [
{
"slot": 1,
"type": "HDD",
"model": "ST16000VE000-2L2103",
"serial": "ABCD1234",
"firmware": "EV02",
"rpm": 7200,
"ata": "ACS-4",
"sata": "SATA 3.3",
"action": "expanding",
"healthy": "good",
"state": "expanding",
"reason": null,
"temperature": 52,
"poweronhrs": 4242,
"life_span": null,
"bad_sector": 0,
"threshold": 10,
"progress": 21.390607518939174,
"estimate": 234395.73300748435
},
{
"slot": 2,
"type": "HDD",
"model": "ST16000VE000-2L2103",
"serial": "ABCD1234",
"firmware": "EV02",
"rpm": 7200,
"ata": "ACS-4",
"sata": "SATA 3.3",
"action": "expanding",
"healthy": "good",
"state": "expanding",
"reason": null,
"temperature": 52,
"poweronhrs": 4242,
"life_span": null,
"bad_sector": 0,
"threshold": 10,
"progress": 21.390607518939174,
"estimate": 234395.73300748435
},
{
"slot": 3,
"type": "HDD",
"model": "ST16000VE000-2L2103",
"serial": "ABCD1234",
"firmware": "EV02",
"rpm": 7200,
"ata": "ACS-4",
"sata": "SATA 3.3",
"action": "expanding",
"healthy": "good",
"state": "expanding",
"reason": null,
"temperature": 51,
"poweronhrs": 4242,
"life_span": null,
"bad_sector": 0,
"threshold": 10,
"progress": 21.390607518939174,
"estimate": 234395.73300748435
},
{
"slot": 4,
"type": "HDD",
"model": "ST16000VE000-2L2103",
"serial": "ABCD1234",
"firmware": "EV02",
"rpm": 7200,
"ata": "ACS-4",
"sata": "SATA 3.3",
"action": "expanding",
"healthy": "good",
"state": "expanding",
"reason": null,
"temperature": 50,
"poweronhrs": 2443,
"life_span": null,
"bad_sector": 0,
"threshold": 10,
"progress": 21.390607518939174,
"estimate": 234395.73300748435
},
{
"slot": 5,
"type": "HDD",
"model": "ST16000VE000-2L2103",
"serial": "ABCD1234",
"firmware": "EV02",
"rpm": 7200,
"ata": "ACS-4",
"sata": "SATA 3.3",
"action": "expanding",
"healthy": "good",
"state": "expanding",
"reason": null,
"temperature": 50,
"poweronhrs": 783,
"life_span": null,
"bad_sector": 0,
"threshold": 10,
"progress": 21.390607518939174,
"estimate": 234395.73300748435
},
{
"slot": 6,
"state": "nodisk"
},
{
"slot": 7,
"type": "HDD",
"model": "ST16000VE002-3BR101",
"serial": "ABCD1234",
"firmware": "EV01",
"rpm": 7200,
"ata": "ACS-4",
"sata": "SATA 3.3",
"action": "expanding",
"healthy": "good",
"state": "expanding",
"reason": null,
"temperature": 45,
"poweronhrs": 18,
"life_span": null,
"bad_sector": 0,
"threshold": 10,
"progress": 21.390607518939174,
"estimate": 234395.73300748435
}
],
"space": [
{
"device": "md3",
"total_bytes": 63713403555840,
"used_bytes": 57006577086464,
"action": "expanding",
"progress": 21.390607518939174,
"estimate": 234395.73300748435
},
{
"device": "md0",
"total_bytes": 0,
"used_bytes": 0,
"action": "syncing",
"progress": 0,
"estimate": null
}
]
},
"tmpfs": {
"available": 934204,
"total": 1048576,
@@ -71,7 +71,7 @@ async def camera_fixture(
await hass.config_entries.async_setup(mock_entry.entry.entry_id)
await hass.async_block_till_done()
assert_entity_counts(hass, Platform.BINARY_SENSOR, 3, 3)
assert_entity_counts(hass, Platform.BINARY_SENSOR, 9, 9)
yield camera_obj
@@ -103,7 +103,7 @@ async def light_fixture(
await hass.config_entries.async_setup(mock_entry.entry.entry_id)
await hass.async_block_till_done()
assert_entity_counts(hass, Platform.BINARY_SENSOR, 2, 2)
assert_entity_counts(hass, Platform.BINARY_SENSOR, 8, 8)
yield light_obj
@@ -138,7 +138,7 @@ async def camera_none_fixture(
await hass.config_entries.async_setup(mock_entry.entry.entry_id)
await hass.async_block_till_done()
assert_entity_counts(hass, Platform.BINARY_SENSOR, 2, 2)
assert_entity_counts(hass, Platform.BINARY_SENSOR, 8, 8)
yield camera_obj
@@ -179,7 +179,7 @@ async def sensor_fixture(
await hass.config_entries.async_setup(mock_entry.entry.entry_id)
await hass.async_block_till_done()
assert_entity_counts(hass, Platform.BINARY_SENSOR, 4, 4)
assert_entity_counts(hass, Platform.BINARY_SENSOR, 10, 10)
yield sensor_obj
@@ -215,7 +215,7 @@ async def sensor_none_fixture(
await hass.config_entries.async_setup(mock_entry.entry.entry_id)
await hass.async_block_till_done()
assert_entity_counts(hass, Platform.BINARY_SENSOR, 4, 4)
assert_entity_counts(hass, Platform.BINARY_SENSOR, 10, 10)
yield sensor_obj