#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2023 Sensirion AG, Switzerland
#
# THIS FILE IS AUTOMATICALLY GENERATED!
#
# Generator: sensirion-driver-generator 0.33.0
# Product: svm4x
# Model-Version: 2.0.3
#
"""
The signal classes specify transformations of the raw sensor signals into a meaningful units.
The generated signal types are used by the driver class and not intended for direct use.
"""
from sensirion_driver_support_types.signals import AbstractSignal
[docs]class SignalTemperature(AbstractSignal):
"""Compensated ambient temperature in degrees celsius."""
def __init__(self, temperature_raw):
self._temperature = temperature_raw / 200.0
@property
def value(self):
return self._temperature
def __str__(self):
return '{0:.2f}'.format(self.value)
[docs]class SignalHumidity(AbstractSignal):
"""Compensated ambient humidity in %RH."""
def __init__(self, humidity_raw):
self._humidity = humidity_raw / 100.0
@property
def value(self):
return self._humidity
def __str__(self):
return '{0:.2f}'.format(self.value)
[docs]class SignalVocIndex(AbstractSignal):
"""VOC Index"""
def __init__(self, voc_index_raw):
self._voc_index = voc_index_raw / 10.0
@property
def value(self):
return self._voc_index
def __str__(self):
return '{0:.2f}'.format(self.value)
[docs]class SignalNoxIndex(AbstractSignal):
"""NOx Index"""
def __init__(self, nox_index_raw):
self._nox_index = nox_index_raw / 10.0
@property
def value(self):
return self._nox_index
def __str__(self):
return '{0:.2f}'.format(self.value)