def get(self): return InputModule.concat_bytearrays( ( InputModule.uint16_to_bytearray((self.__sensor.get_temperature() + 100) * 100), InputModule.uint16_to_bytearray(self.__sensor.get_humidity() * 100), InputModule.uint16_to_bytearray(self.__sensor.get_co2()) ) )
def get(self): return InputModule.concat_bytearrays( ( InputModule.uint16_to_bytearray(self.sensor.get_x_acceleration()), InputModule.uint16_to_bytearray(self.sensor.get_y_acceleration()), InputModule.uint16_to_bytearray(self.sensor.get_z_acceleration()), ) )
def get(self): return InputModule.concat_bytearrays( (InputModule.uint16_to_bytearray( (self.sensor.temperature + 100) * 100), InputModule.uint16_to_bytearray(self.sensor.humidity * 100), InputModule.uint32_to_bytearray(self.sensor.pressure * 100), InputModule.uint16_to_bytearray(self.sensor.altitude * 100), InputModule.uint32_to_bytearray(self.sensor.gas)))
def get(self): data = self.sensor.MyGPS() # no gps if data == None: return InputModule.concat_bytearrays( (InputModule.uint32_to_bytearray(0), InputModule.uint32_to_bytearray(0), InputModule.uint16_to_bytearray(0))) return InputModule.concat_bytearrays( (InputModule.uint32_to_bytearray(data[0] * 10000), InputModule.uint32_to_bytearray(data[1] * 10000), InputModule.uint16_to_bytearray(data[2])))
def get(self): try: data = self.sensor.getData() return InputModule.concat_bytearrays( ( InputModule.uint16_to_bytearray(data[0][1]*10), InputModule.uint16_to_bytearray(data[1][1]*10), ) ) except: b = bytearray(20) for i in range(0, len(b)): b[i] = 0 return b
def get(self): try: data = self.sensor.getData() return InputModule.concat_bytearrays( (InputModule.uint16_to_bytearray(data["pm1_par1"] * 100), InputModule.uint16_to_bytearray(data["pm25_par2"] * 100), InputModule.uint16_to_bytearray(data["pm10_par3"] * 100), InputModule.uint16_to_bytearray(data["pm1"] * 100), InputModule.uint16_to_bytearray(data["pm25"] * 100), InputModule.uint16_to_bytearray(data["pm10"] * 100), InputModule.uint16_to_bytearray(data["pm05_cnt"] * 100), InputModule.uint16_to_bytearray(data["pm1_cnt"] * 100), InputModule.uint16_to_bytearray(data["pm25_cnt"] * 100), InputModule.uint16_to_bytearray(data["pm5_cnt"] * 100), InputModule.uint16_to_bytearray(data["pm10_cnt"] * 100), InputModule.uint16_to_bytearray(data["grain"] * 100))) except: b = bytearray(24) for i in range(0, len(b)): b[i] = 0 return b
def get(self): array = bytearray(1) return InputModule.uint16_to_bytearray( self.sensor.read_input_registers())
def get(self): return InputModule.uint16_to_bytearray(self.sensor.measure())