update
This commit is contained in:
@@ -292,9 +292,9 @@ class SensorPayload:
|
||||
def set_bme280(self, temperature, humidity, pressure):
|
||||
"""Set BME280 values (bytes 16-21)"""
|
||||
if temperature is not None:
|
||||
self.payload[16:18] = struct.pack('>h', int(temperature * 10)) # Signed
|
||||
self.payload[16:18] = struct.pack('>h', int(temperature * 100)) # Signed
|
||||
if humidity is not None:
|
||||
self.payload[18:20] = struct.pack('>H', int(humidity * 10))
|
||||
self.payload[18:20] = struct.pack('>H', int(humidity * 100))
|
||||
if pressure is not None:
|
||||
self.payload[20:22] = struct.pack('>H', int(pressure))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user