From e123c6fa9b6772e1de8697b7f10e541b4c9e1948 Mon Sep 17 00:00:00 2001 From: eric14142004 Date: Mon, 25 Mar 2024 01:12:28 -0700 Subject: [PATCH] Update environment_sensor.py Dirigera currently supports adding third-party zigbee sensors, such as aqara temperature sensors. These sensors may not necessarily has pm25 and voc data. --- src/dirigera/devices/environment_sensor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dirigera/devices/environment_sensor.py b/src/dirigera/devices/environment_sensor.py index 0a9dca4..546629c 100644 --- a/src/dirigera/devices/environment_sensor.py +++ b/src/dirigera/devices/environment_sensor.py @@ -1,5 +1,5 @@ from __future__ import annotations -from typing import Any, Dict +from typing import Any, Dict, Optional from .device import Attributes, Device from ..hub.abstract_smart_home_hub import AbstractSmartHomeHub @@ -7,10 +7,10 @@ class EnvironmentSensorAttributes(Attributes): current_temperature: float current_r_h: int - current_p_m25: int - max_measured_p_m25: int - min_measured_p_m25: int - voc_index: int + current_p_m25: Optional[int] + max_measured_p_m25: Optional[int] + min_measured_p_m25: Optional[int] + voc_index: Optional[int] class EnvironmentSensor(Device):