mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add Netatmo weather trend sensors (#41318)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
4d5948b4d0
commit
6065ab118f
@ -49,8 +49,10 @@ SUPPORTED_PUBLIC_SENSOR_TYPES = [
|
||||
|
||||
SENSOR_TYPES = {
|
||||
"temperature": ["Temperature", TEMP_CELSIUS, None, DEVICE_CLASS_TEMPERATURE],
|
||||
"temp_trend": ["Temperature trend", None, "mdi:trending-up", None],
|
||||
"co2": ["CO2", CONCENTRATION_PARTS_PER_MILLION, "mdi:molecule-co2", None],
|
||||
"pressure": ["Pressure", PRESSURE_MBAR, None, DEVICE_CLASS_PRESSURE],
|
||||
"pressure_trend": ["Pressure trend", None, "mdi:trending-up", None],
|
||||
"noise": ["Noise", "dB", "mdi:volume-high", None],
|
||||
"humidity": ["Humidity", PERCENTAGE, None, DEVICE_CLASS_HUMIDITY],
|
||||
"rain": ["Rain", LENGTH_MILLIMETERS, "mdi:weather-rainy", None],
|
||||
@ -312,6 +314,8 @@ class NetatmoSensor(NetatmoBase):
|
||||
try:
|
||||
if self.type == "temperature":
|
||||
self._state = round(data["Temperature"], 1)
|
||||
elif self.type == "temp_trend":
|
||||
self._state = data["temp_trend"]
|
||||
elif self.type == "humidity":
|
||||
self._state = data["Humidity"]
|
||||
elif self.type == "rain":
|
||||
@ -326,6 +330,8 @@ class NetatmoSensor(NetatmoBase):
|
||||
self._state = data["CO2"]
|
||||
elif self.type == "pressure":
|
||||
self._state = round(data["Pressure"], 1)
|
||||
elif self.type == "pressure_trend":
|
||||
self._state = data["pressure_trend"]
|
||||
elif self.type == "battery_percent":
|
||||
self._state = data["battery_percent"]
|
||||
elif self.type == "battery_lvl":
|
||||
|
Loading…
x
Reference in New Issue
Block a user