Skip to content

Commit 3206506

Browse files
authored
Merge pull request #24 from golles/housekeeping
Housekeeping, implement upstream changes
2 parents 2eb3db1 + d2c0fbf commit 3206506

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

.devcontainer/devcontainer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
22
{
3-
"image": "ludeeus/container:integration-debian",
3+
"image": "ghcr.io/ludeeus/devcontainer/integration:stable",
44
"name": "HA KNMI development",
55
"context": "..",
66
"appPort": [
@@ -16,7 +16,7 @@
1616
"settings": {
1717
"files.eol": "\n",
1818
"editor.tabSize": 4,
19-
"terminal.integrated.defaultProfile.linux": "bash",
19+
"terminal.integrated.shell.linux": "/bin/bash",
2020
"python.pythonPath": "/usr/bin/python3",
2121
"python.analysis.autoSearchPaths": false,
2222
"python.linting.pylintEnabled": true,

custom_components/knmi/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
5959
hass.config_entries.async_forward_entry_setup(entry, platform)
6060
)
6161

62-
entry.add_update_listener(async_reload_entry)
62+
entry.async_on_unload(entry.add_update_listener(async_reload_entry))
6363
return True
6464

6565

custom_components/knmi/sensor.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Sensor platform for knmi."""
2+
from homeassistant.components.sensor import SensorEntity
23
from homeassistant.const import CONF_NAME
4+
35
from .const import DEFAULT_NAME, DOMAIN, SENSORS
46
from .entity import KnmiEntity
57

@@ -26,7 +28,7 @@ async def async_setup_entry(hass, entry, async_add_devices):
2628
async_add_devices(sensors)
2729

2830

29-
class KnmiSensor(KnmiEntity):
31+
class KnmiSensor(KnmiEntity, SensorEntity):
3032
"""Knmi Sensor class."""
3133

3234
def __init__(
@@ -55,12 +57,12 @@ def name(self):
5557
return f"{DEFAULT_NAME} {self.entry_name} {self._name}"
5658

5759
@property
58-
def state(self):
59-
"""Return the state of the sensor."""
60+
def native_value(self):
61+
"""Return the native_value of the sensor."""
6062
return super().getData(self._data_key)
6163

6264
@property
63-
def unit_of_measurement(self):
65+
def native_unit_of_measurement(self):
6466
"""Return the unit of measurement of this entity, if any."""
6567
return self._unit_of_measurement
6668

0 commit comments

Comments
 (0)