More mods

This commit is contained in:
G Johansson
2026-05-03 17:36:45 +00:00
parent 79703601eb
commit e049a85785
3 changed files with 10 additions and 3 deletions
@@ -187,4 +187,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload Compensation config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DATA_COMPENSATION].pop(entry.entry_id, None)
return unload_ok
@@ -1,4 +1,4 @@
"""Config flow for statistics."""
"""Config flow for Compensation integration."""
from __future__ import annotations
@@ -1,6 +1,9 @@
"""Compensation constants."""
from typing import Any
from homeassistant.const import Platform
from homeassistant.util.hass_dict import HassKey
DOMAIN = "compensation"
PLATFORMS = [Platform.SENSOR]
@@ -16,7 +19,8 @@ CONF_PRECISION = "precision"
CONF_POLYNOMIAL = "polynomial"
CONF_POLYNOMIAL_CONFIG = "polynomial_config"
DATA_COMPENSATION = "compensation_data"
DATA_COMPENSATION: HassKey[dict[str, Any]] = HassKey("compensation_data")
DEFAULT_DEGREE = 1
DEFAULT_NAME = "Compensation"