diff --git a/CHANGELOG.md b/CHANGELOG.md index d298bf0..a0f32af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v1.0.12 + +- Fix missing references [Issue #103](https://github.com/elad-bar/ha-hpprinter/issues/103) +- Fix breaking change to ConfigEntry + ## v1.0.11 _Minimum HA Version: 2024.1.0b0_ diff --git a/__main__.py b/__main__.py index fcf400c..b1281e9 100644 --- a/__main__.py +++ b/__main__.py @@ -19,6 +19,7 @@ def __init__(self): config_entry: ConfigEntry = ConfigEntry( version=0, + minor_version=0, domain=DOMAIN, title=DEFAULT_NAME, data=data, diff --git a/custom_components/hpprinter/__init__.py b/custom_components/hpprinter/__init__.py index 0f72db6..7c6730a 100644 --- a/custom_components/hpprinter/__init__.py +++ b/custom_components/hpprinter/__init__.py @@ -19,7 +19,7 @@ _LOGGER = logging.getLogger(__name__) -async def async_setup(hass, config): +async def async_setup(_hass, _config): return True diff --git a/custom_components/hpprinter/binary_sensor.py b/custom_components/hpprinter/binary_sensor.py index 8eaab49..d2f0c4d 100644 --- a/custom_components/hpprinter/binary_sensor.py +++ b/custom_components/hpprinter/binary_sensor.py @@ -7,7 +7,10 @@ import logging -from homeassistant.components.binary_sensor import BinarySensorEntity +from homeassistant.components.binary_sensor import ( + BinarySensorDeviceClass, + BinarySensorEntity, +) from homeassistant.core import HomeAssistant from .helpers.const import * @@ -34,7 +37,7 @@ async def async_setup_entry(hass: HomeAssistant, entry, async_add_entities): ) -async def async_unload_entry(hass, config_entry): +async def async_unload_entry(_hass, config_entry): _LOGGER.info(f"async_unload_entry {CURRENT_DOMAIN}: {config_entry}") return True diff --git a/custom_components/hpprinter/helpers/const.py b/custom_components/hpprinter/helpers/const.py index 71db70c..89d55f6 100644 --- a/custom_components/hpprinter/helpers/const.py +++ b/custom_components/hpprinter/helpers/const.py @@ -118,8 +118,8 @@ HP_INK_MAPPING = {"C": "Cyan", "Y": "Yellow", "M": "Magenta", "K": "Black"} -SIGNAL_UPDATE_BINARY_SENSOR = f"{DEFAULT_NAME}_{DOMAIN_BINARY_SENSOR}_SIGNLE_UPDATE" -SIGNAL_UPDATE_SENSOR = f"{DEFAULT_NAME}_{DOMAIN_SENSOR}_SIGNLE_UPDATE" +SIGNAL_UPDATE_BINARY_SENSOR = f"{DEFAULT_NAME}_{DOMAIN_BINARY_SENSOR}_SIGNAL_UPDATE" +SIGNAL_UPDATE_SENSOR = f"{DEFAULT_NAME}_{DOMAIN_SENSOR}_SIGNAL_UPDATE" SIGNALS = { DOMAIN_BINARY_SENSOR: SIGNAL_UPDATE_BINARY_SENSOR, diff --git a/custom_components/hpprinter/managers/config_flow_manager.py b/custom_components/hpprinter/managers/config_flow_manager.py index 483ecf2..ef47963 100644 --- a/custom_components/hpprinter/managers/config_flow_manager.py +++ b/custom_components/hpprinter/managers/config_flow_manager.py @@ -126,6 +126,7 @@ def update_data(self, data: dict, update_entry: bool = False): def _update_entry(self): entry = ConfigEntry( version=0, + minor_version=0, domain="", title="", data=self.data, diff --git a/custom_components/hpprinter/managers/entity_manager.py b/custom_components/hpprinter/managers/entity_manager.py index 6dc5839..57960f2 100644 --- a/custom_components/hpprinter/managers/entity_manager.py +++ b/custom_components/hpprinter/managers/entity_manager.py @@ -2,6 +2,8 @@ import sys from typing import Optional +from homeassistant.components.binary_sensor import BinarySensorDeviceClass +from homeassistant.components.sensor import SensorStateClass from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_registry import EntityRegistry diff --git a/custom_components/hpprinter/managers/storage_manager.py b/custom_components/hpprinter/managers/storage_manager.py index b61b736..5773b73 100644 --- a/custom_components/hpprinter/managers/storage_manager.py +++ b/custom_components/hpprinter/managers/storage_manager.py @@ -1,4 +1,4 @@ -"""Storage handers.""" +"""Storage handlers.""" import logging from homeassistant.helpers.json import JSONEncoder diff --git a/custom_components/hpprinter/manifest.json b/custom_components/hpprinter/manifest.json index 7095daf..f2fb8c8 100644 --- a/custom_components/hpprinter/manifest.json +++ b/custom_components/hpprinter/manifest.json @@ -9,5 +9,5 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/elad-bar/ha-hpprinter/issues", "requirements": ["xmltodict==0.12.0"], - "version": "1.0.11" + "version": "1.0.12" } diff --git a/custom_components/hpprinter/models/entity_data.py b/custom_components/hpprinter/models/entity_data.py index d848050..c505fb4 100644 --- a/custom_components/hpprinter/models/entity_data.py +++ b/custom_components/hpprinter/models/entity_data.py @@ -1,5 +1,8 @@ from typing import Optional +from homeassistant.components.binary_sensor import BinarySensorDeviceClass +from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass + from ..helpers.const import * diff --git a/custom_components/hpprinter/sensor.py b/custom_components/hpprinter/sensor.py index c11569b..5c5abbc 100644 --- a/custom_components/hpprinter/sensor.py +++ b/custom_components/hpprinter/sensor.py @@ -7,7 +7,11 @@ import logging -from homeassistant.components.sensor import SensorEntity +from homeassistant.components.sensor import ( + SensorDeviceClass, + SensorEntity, + SensorStateClass, +) from homeassistant.core import HomeAssistant from .helpers.const import * @@ -33,7 +37,7 @@ async def async_setup_entry(hass: HomeAssistant, entry, async_add_entities): ) -async def async_unload_entry(hass, config_entry): +async def async_unload_entry(_hass, config_entry): _LOGGER.info(f"async_unload_entry {CURRENT_DOMAIN}: {config_entry}") return True