Source code for sensirion_i2c_sfm3304.result_types

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) Copyright 2025 Sensirion AG, Switzerland
#
#     THIS FILE IS AUTOMATICALLY GENERATED!
#
# Generator:     sensirion-driver-generator 1.1.2
# Product:       sfm3304
# Model-Version: 1.0.0
#
"""
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): """Measured temperature in degrees Celsius. The raw value is scaled appropriately.""" 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 SignalFlow(AbstractSignal): """ This signal represents the measured flow in slm (at 20°C and 1013.25hPa). It is scaled with the corresponding scaling factor and offset. """ def __init__(self, flow_raw): self._flow = flow_raw / 120.0 @property def value(self): return self._flow def __str__(self): return '{0:.2f}'.format(self.value)