Add Process binary sensor in System Monitor (#108585)

* Process binary sensor in System Monitor

* Add repair flow

* add issue

* add platform

* fix repair

* Tests

* Fix tests

* add minor version

* migrate

* Mod repairs

* Fix tests

* config flow test

* Last fixes

* Review comments

* Remove entities during repair

* Remove snapshot
This commit is contained in:
G Johansson
2024-02-05 20:09:05 -05:00
committed by GitHub
parent 668d036f71
commit 1706156faf
14 changed files with 873 additions and 45 deletions

View File

@ -1,4 +1,5 @@
"""Support for monitoring the local system."""
from __future__ import annotations
from collections.abc import Callable
@ -39,6 +40,7 @@ from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType, StateType
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.util import slugify
@ -638,6 +640,20 @@ async def async_setup_entry( # noqa: C901
True,
)
)
async_create_issue(
hass,
DOMAIN,
"process_sensor",
breaks_in_ha_version="2024.9.0",
is_fixable=True,
is_persistent=False,
severity=IssueSeverity.WARNING,
translation_key="process_sensor",
data={
"entry_id": entry.entry_id,
"processes": _entry[CONF_PROCESS],
},
)
continue
if _type == "processor_use":