Source code for caspia.gateway.services.sensors.humidity.service

from caspia.gateway.services import GatewayService
from caspia.meadow.services import HumiditySensorBase


[docs]class HumiditySensor(GatewayService, HumiditySensorBase): def __new__(cls, config, network, storage): if cls != HumiditySensor: return super().__new__(cls, config, network, storage) if 'sht2x' in config: from .sht2x import SHT2XHumiditySensor as cls elif 'scd30' in config: from .scd30 import SCD30HumiditySensor as cls else: raise RuntimeError('invalid temperature sensor config') return cls(config=config, network=network, storage=storage)