add additional weather sensor options (VOC, IAQ, CO2)

This commit is contained in:
Kim Bauters 2021-05-24 09:22:08 +01:00
parent bf23e23c0f
commit 3b554b5660

View File

@ -47,6 +47,9 @@ class WeatherSensor(Flag):
RAIN_INTENSITY = auto() RAIN_INTENSITY = auto()
RAIN_PROBABILITY = auto() RAIN_PROBABILITY = auto()
SOLAR_RADIATION = auto() SOLAR_RADIATION = auto()
IAQ = auto()
VOC = auto()
CO2 = auto()
# Constants used to create a family of light sensors. # Constants used to create a family of light sensors.
@ -324,6 +327,12 @@ class Publisher:
keys.append("rain_probability") keys.append("rain_probability")
if WeatherSensor.SOLAR_RADIATION in version: if WeatherSensor.SOLAR_RADIATION in version:
keys.append("solar_radiation") keys.append("solar_radiation")
if WeatherSensor.IAQ in version:
keys.append("iaq")
if WeatherSensor.VOC in version:
keys.append("voc")
if WeatherSensor.CO2 in version:
keys.append("co2")
return Payload(self, "weather", keys=keys, return Payload(self, "weather", keys=keys,
presets=[("version", version.value)]) presets=[("version", version.value)])