Skip to content

Commit

Permalink
Fix HA core 2022.07 deprecation warnings (Closes: #42) (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Jul 7, 2022
1 parent c802598 commit d7f4da1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
24 changes: 12 additions & 12 deletions custom_components/goecharger_mqtt/definitions/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,35 @@ class GoEChargerNumberEntityDescription(
name="Requested current",
entity_category=EntityCategory.CONFIG,
device_class=DEVICE_CLASS_CURRENT,
unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
entity_registry_enabled_default=True,
disabled=False,
max_value=32,
min_value=6,
step=1,
native_max_value=32,
native_min_value=6,
native_step=1,
),
GoEChargerNumberEntityDescription(
key="ate",
name="Automatic stop energy",
entity_category=EntityCategory.CONFIG,
device_class=DEVICE_CLASS_ENERGY,
unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=ENERGY_WATT_HOUR,
entity_registry_enabled_default=True,
disabled=False,
max_value=100000,
min_value=1,
step=1,
native_max_value=100000,
native_min_value=1,
native_step=1,
),
GoEChargerNumberEntityDescription(
key="att",
name="Automatic stop time",
entity_category=EntityCategory.CONFIG,
device_class=None,
unit_of_measurement=TIME_SECONDS,
native_unit_of_measurement=TIME_SECONDS,
entity_registry_enabled_default=True,
disabled=False,
max_value=86400,
min_value=60,
step=1,
native_max_value=86400,
native_min_value=60,
native_step=1,
),
)
2 changes: 1 addition & 1 deletion custom_components/goecharger_mqtt/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "goecharger_mqtt",
"name": "go-eCharger (MQTT)",
"config_flow": true,
"version": "0.10.0",
"version": "0.11.0",
"documentation": "https://github.com/syssi/homeassistant-goecharger-mqtt",
"issue_tracker": "https://github.com/syssi/homeassistant-goecharger-mqtt/issues",
"requirements": [],
Expand Down
6 changes: 3 additions & 3 deletions custom_components/goecharger_mqtt/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(
self.entity_description = description
self._attr_available = False

async def async_set_value(self, value: float) -> None:
async def async_set_native_value(self, value: float) -> None:
"""Update the current value."""
await mqtt.async_publish(self.hass, f"{self._topic}/set", int(value))

Expand All @@ -58,9 +58,9 @@ def message_received(message):
)
else:
if message.payload == "null":
self._attr_value = None
self._attr_native_value = None
else:
self._attr_value = message.payload
self._attr_native_value = message.payload

self.async_write_ha_state()

Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"name": "go-eCharger integration for Home Assistant using the MQTT API",
"content_in_root": false,
"render_readme": true,
"homeassistant": "2022.2.0"
"homeassistant": "2022.7.0"
}

0 comments on commit d7f4da1

Please sign in to comment.