Skip to content

Commit

Permalink
fix issues introduced in previous version (1.0.11)
Browse files Browse the repository at this point in the history
  • Loading branch information
elad-bar committed Jan 2, 2024
1 parent f83994b commit 97f89d7
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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_
Expand Down
1 change: 1 addition & 0 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self):

config_entry: ConfigEntry = ConfigEntry(
version=0,
minor_version=0,
domain=DOMAIN,
title=DEFAULT_NAME,
data=data,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/hpprinter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
_LOGGER = logging.getLogger(__name__)


async def async_setup(hass, config):
async def async_setup(_hass, _config):
return True


Expand Down
7 changes: 5 additions & 2 deletions custom_components/hpprinter/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions custom_components/hpprinter/helpers/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions custom_components/hpprinter/managers/entity_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion custom_components/hpprinter/managers/storage_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Storage handers."""
"""Storage handlers."""
import logging

from homeassistant.helpers.json import JSONEncoder
Expand Down
2 changes: 1 addition & 1 deletion custom_components/hpprinter/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 3 additions & 0 deletions custom_components/hpprinter/models/entity_data.py
Original file line number Diff line number Diff line change
@@ -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 *


Expand Down
8 changes: 6 additions & 2 deletions custom_components/hpprinter/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand All @@ -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
Expand Down

0 comments on commit 97f89d7

Please sign in to comment.