Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions homeassistant/components/netatmo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@

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],
Expand Down Expand Up @@ -138,6 +140,7 @@ async def find_entities(data_class_name):
for c in data_class.get_monitored_conditions(module_id=module["_id"])
]
for condition in conditions:
print(condition)
Comment thread
balloob marked this conversation as resolved.
Outdated
if f"{condition}_value" in SENSOR_TYPES:
conditions.append(f"{condition}_value")
elif f"{condition}_lvl" in SENSOR_TYPES:
Expand Down Expand Up @@ -312,6 +315,8 @@ def async_update_callback(self):
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":
Expand All @@ -326,6 +331,8 @@ def async_update_callback(self):
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":
Expand Down