2626CHAR_UUID_ILLUMINANCE_ACCELEROMETER = UUID ('b42e1348-ade7-11e4-89d3-123b93f75cba' )
2727CHAR_UUID_WAVE_PLUS_DATA = UUID ('b42e2a68-ade7-11e4-89d3-123b93f75cba' )
2828CHAR_UUID_WAVE_2_DATA = UUID ('b42e4dcc-ade7-11e4-89d3-123b93f75cba' )
29+ CHAR_UUID_WAVEMINI_DATA = UUID ('b42e3b98-ade7-11e4-89d3-123b93f75cba' )
2930
3031Characteristic = namedtuple ('Characteristic' , ['uuid' , 'name' , 'format' ])
3132
@@ -49,7 +50,7 @@ def __str__(self):
4950
5051sensors_characteristics_uuid = [CHAR_UUID_DATETIME , CHAR_UUID_TEMPERATURE , CHAR_UUID_HUMIDITY , CHAR_UUID_RADON_1DAYAVG ,
5152 CHAR_UUID_RADON_LONG_TERM_AVG , CHAR_UUID_ILLUMINANCE_ACCELEROMETER ,
52- CHAR_UUID_WAVE_PLUS_DATA ,CHAR_UUID_WAVE_2_DATA ]
53+ CHAR_UUID_WAVE_PLUS_DATA ,CHAR_UUID_WAVE_2_DATA , CHAR_UUID_WAVEMINI_DATA ]
5354
5455sensors_characteristics_uuid_str = [str (x ) for x in sensors_characteristics_uuid ]
5556
@@ -100,6 +101,18 @@ def decode_data(self, raw_data):
100101 return data
101102
102103
104+ class WaveMiniDecode (BaseDecode ):
105+ def decode_data (self , raw_data ):
106+ val = super ().decode_data (raw_data )
107+ val = val [self .name ]
108+ data = {}
109+ data ['date_time' ] = str (datetime .isoformat (datetime .now ()))
110+ data ['temperature' ] = round ( val [1 ]/ 100.0 - 273.15 ,2 )
111+ data ['humidity' ] = val [3 ]/ 100.0
112+ data ['voc' ] = val [4 ]* 1.0
113+ return data
114+
115+
103116class WaveDecodeDate (BaseDecode ):
104117 def decode_data (self , raw_data ):
105118 val = super ().decode_data (raw_data )[self .name ]
@@ -123,7 +136,8 @@ def decode_data(self, raw_data):
123136 str (CHAR_UUID_RADON_LONG_TERM_AVG ):BaseDecode (name = "radon_longterm_avg" , format_type = 'H' , scale = 1.0 ),
124137 str (CHAR_UUID_ILLUMINANCE_ACCELEROMETER ):WaveDecodeIluminAccel (name = "illuminance_accelerometer" , format_type = 'BB' , scale = 1.0 ),
125138 str (CHAR_UUID_TEMPERATURE ):BaseDecode (name = "temperature" , format_type = 'h' , scale = 1.0 / 100.0 ),
126- str (CHAR_UUID_WAVE_2_DATA ):Wave2Decode (name = "Wave2" , format_type = '<4B8H' , scale = 1.0 ),}
139+ str (CHAR_UUID_WAVE_2_DATA ):Wave2Decode (name = "Wave2" , format_type = '<4B8H' , scale = 1.0 ),
140+ str (CHAR_UUID_WAVEMINI_DATA ):WaveMiniDecode (name = "WaveMini" , format_type = '<HHHHHHLL' , scale = 1.0 ),}
127141
128142
129143class AirthingsWaveDetect :
0 commit comments