Skip to content

Commit

Permalink
0.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gvigroux committed Jun 18, 2024
1 parent 42cd825 commit e7dfc7e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions custom_components/hon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import ATTR_DEVICE_ID, CONF_EMAIL, CONF_PASSWORD
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.core import HomeAssistant

from homeassistant.helpers import entity_registry as er
from homeassistant.helpers import device_registry as dr
Expand Down Expand Up @@ -54,7 +54,7 @@ def update_sensor(hass, device_id, mac, sensor_name, state):
hass.states.async_set(entry.entity_id, state, inputStateObject.attributes)


async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
hon = HonConnection(hass, entry)
await hon.async_authorize()

Expand Down
2 changes: 1 addition & 1 deletion custom_components/hon/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://github.com/gvigroux/hon",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/gvigroux/hon/issues",
"version": "0.7.2"
"version": "0.7.3"
}
5 changes: 2 additions & 3 deletions custom_components/hon/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __init__(self, key, attributes):
self._step = int(attributes["incrementValue"])
self._default = int(attributes.get("defaultValue", self._min))
except (TypeError, ValueError):
_LOGGER.error(attributes["minimumValue"])
self._min = float(attributes["minimumValue"].replace(",","."))
self._max = float(attributes["maximumValue"].replace(",","."))
self._step = float(attributes["incrementValue"].replace(",","."))
Expand All @@ -71,7 +70,7 @@ def __repr__(self):
return f"{self.__class__} (<{self.key}> [{self._min} - {self._max}])"

def dump(self):
return f"{self.key}: \t\t[{self._min} - {self._max}] - Default: {self._default}"
return f"{self.key}: \t\t[{self._min} - {self._max}] - Default: {self._default} - Step: {self._step}"

@property
def min(self):
Expand Down Expand Up @@ -103,7 +102,7 @@ def value(self, value):
if self._min <= value <= self._max and not value % self._step:
self._value = value
else:
raise ValueError(f"Allowed: min {self._min} max {self._max} step {self._step}")
raise ValueError(f"Value [{value}] - Allowed: min {self._min} max {self._max} step {self._step}")


class HonParameterEnum(HonParameter):
Expand Down

0 comments on commit e7dfc7e

Please sign in to comment.