14
14
)
15
15
from homeassistant .const import (
16
16
CONF_NAME ,
17
- TEMP_CELSIUS ,
18
17
)
19
18
20
19
from .const import CONDITIONS_MAP , DEFAULT_NAME , DOMAIN , WIND_DIRECTION_MAP
@@ -39,57 +38,54 @@ def name(self):
39
38
"""Return the name of the sensor."""
40
39
return f"{ DEFAULT_NAME } { self .entry_name } "
41
40
42
- @property
43
- def state (self ):
44
- """Return the state of the sensor."""
45
- return self .condition
46
-
47
41
@property
48
42
def condition (self ):
49
43
"""Return the current condition."""
50
44
if super ().getData ("d0weer" ) is not None :
51
45
return CONDITIONS_MAP [super ().getData ("d0weer" )]
46
+ return None
52
47
53
48
@property
54
- def temperature (self ):
49
+ def native_temperature (self ):
55
50
"""Return the temperature."""
56
51
if super ().getData ("temp" ) is not None :
57
52
return float (super ().getData ("temp" ))
53
+ return None
58
54
59
55
@property
60
- def temperature_unit (self ):
61
- """Return the unit of measurement."""
62
- return TEMP_CELSIUS
63
-
64
- @property
65
- def pressure (self ):
56
+ def native_pressure (self ):
66
57
"""Return the pressure."""
67
58
if super ().getData ("luchtd" ) is not None :
68
59
return float (super ().getData ("luchtd" ))
60
+ return None
69
61
70
62
@property
71
- def humidity (self ):
63
+ def native_humidity (self ):
72
64
"""Return the humidity."""
73
65
if super ().getData ("lv" ) is not None :
74
66
return float (super ().getData ("lv" ))
67
+ return None
75
68
76
69
@property
77
- def wind_speed (self ):
70
+ def native_wind_speed (self ):
78
71
"""Return the wind speed."""
79
72
if super ().getData ("windkmh" ) is not None :
80
73
return float (super ().getData ("windkmh" ))
74
+ return None
81
75
82
76
@property
83
77
def wind_bearing (self ):
84
78
"""Return the wind direction."""
85
79
if super ().getData ("windr" ) is not None :
86
80
return WIND_DIRECTION_MAP [super ().getData ("windr" )]
81
+ return None
87
82
88
83
@property
89
- def visibility (self ):
84
+ def native_visibility (self ):
90
85
"""Return the wind direction."""
91
86
if super ().getData ("zicht" ) is not None :
92
- return float (super ().getData ("zicht" )) / 10
87
+ return float (super ().getData ("zicht" ))
88
+ return None
93
89
94
90
@property
95
91
def forecast (self ):
0 commit comments