Skip to content

Commit

Permalink
Fix deprecated methods for numbers platform. Closes #34
Browse files Browse the repository at this point in the history
  • Loading branch information
erikkastelec committed Sep 12, 2022
1 parent 32730d7 commit 7d117f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion custom_components/wemportal/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"documentation": "https://github.com/erikkastelec/hass-WEM-Portal",
"issue_tracker": "https://github.com/erikkastelec/hass-WEM-Portal/issues",
"dependencies": [],
"version": "1.3.7",
"version": "1.3.8",
"codeowners": [
"@erikkastelec"
],
Expand Down
10 changes: 5 additions & 5 deletions custom_components/wemportal/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ def __init__(self, coordinator, _unique_id, entity_data):
self._icon = entity_data["icon"]
self._unit = entity_data["unit"]
self._state = self.state
self._attr_min_value = entity_data["min_value"]
self._attr_max_value = entity_data["max_value"]
self._attr_step = entity_data["step"]
self._attr_native_min_value = entity_data["min_value"]
self._attr_native_max_value = entity_data["max_value"]
self._attr_native_step = entity_data["step"]
self._module_index = entity_data["ModuleIndex"]
self._module_type = entity_data["ModuleType"]

async def async_set_value(self, value: float) -> None:
async def async_set_native_value(self, value: float) -> None:
"""Update the current value."""
await self.hass.async_add_executor_job(
self.coordinator.api.change_value,
Expand Down Expand Up @@ -108,7 +108,7 @@ def state(self):
return None

@property
def unit_of_measurement(self):
def native_unit_of_measurement(self):
"""Return the unit of measurement of this entity, if any."""
return self._unit

Expand Down

0 comments on commit 7d117f7

Please sign in to comment.