@@ -64,6 +64,11 @@ class BTHome:
6464 GARAGE_DOOR_BINARY = const (0x1B ) # 0 (False = Closed) 1 (True = Open)
6565 GAS_BINARY = const (0x1C ) # 0 (False = Clear) 1 (True = Detected)
6666 HEAT_BINARY = const (0x1D ) # 0 (False = Normal) 1 (True = Hot)
67+ LIGHT_BINARY = const (0x1E ) # 0 (False = No light) 1 (True = Light detected)
68+ LOCK_BINARY = const (0x1F ) # 0 (False = Locked) 1 (True = Unlocked)
69+ MOISTURE_BINARY = const (0x20 ) # 0 (False = Dry) 1 (True = Wet)
70+ MOTION_BINARY = const (0x21 ) # 0 (False = Clear) 1 (True = Detected)
71+ MOVING_BINARY = const (0x22 ) # 0 (False = Not moving) 1 (True = Moving)
6772 HUMIDITY_UINT8_X1 = const (0x2E ) # %
6873 MOISTURE_UINT8_X1 = const (0x2F ) # %
6974 COUNT_UINT16_X1 = const (0x3D )
@@ -134,6 +139,11 @@ class BTHome:
134139 GARAGE_DOOR_BINARY : "garage_door" , # 0x1B
135140 GAS_BINARY : "gas_detected" , # 0x1C
136141 HEAT_BINARY : "heat" , # 0x1D
142+ LIGHT_BINARY : "light" , # 0x1E
143+ LOCK_BINARY : "lock" , # 0x1F
144+ MOISTURE_BINARY : "moisture_detected" , # 0x20
145+ MOTION_BINARY : "motion" , # 0x21
146+ MOVING_BINARY : "moving" , # 0x22
137147 HUMIDITY_UINT8_X1 : "humidity" , # 0x2E
138148 MOISTURE_UINT8_X1 : "moisture" , # 0x2F
139149 COUNT_UINT16_X1 : "count" , # 0x3D
@@ -175,10 +185,13 @@ class BTHome:
175185 }
176186
177187 # Properties below are updated externally when sensor values are read.
188+ # See "Sensor Data" table at https://bthome.io/format/ Property column.
178189 # There is some overlap in property names in the BTHome format. For
179190 # example: moisture as in percent and moisture as in detected.
180- # In these cases, the binary property will have "_detected" appended.
181- # See "Sensor Data" table at https://bthome.io/format/ Property column.
191+ # In these cases, the binary property will have the description of a
192+ # True condition to further describe the property. Examples are:
193+ # _charging, in the case of battery; _detected, in the case of gas,
194+ # moisture, or motion.
182195 acceleration = 0
183196 battery = 0
184197 battery_low = False
@@ -205,8 +218,13 @@ class BTHome:
205218 heat = False
206219 humidity = 0
207220 illuminance = 0
221+ light = False
222+ lock = False
208223 mass = 0
209224 moisture = 0
225+ moisture_detected = False
226+ motion = False
227+ moving = False
210228 pm10 = 0
211229 pm2_5 = 0
212230 power = 0
@@ -328,6 +346,11 @@ def _pack_raw_text(self, object_id, value):
328346 GARAGE_DOOR_BINARY : _pack_binary ,
329347 GAS_BINARY : _pack_binary ,
330348 HEAT_BINARY : _pack_binary ,
349+ LIGHT_BINARY : _pack_binary ,
350+ LOCK_BINARY : _pack_binary ,
351+ MOISTURE_BINARY : _pack_binary ,
352+ MOTION_BINARY : _pack_binary ,
353+ MOVING_BINARY : _pack_binary ,
331354 HUMIDITY_UINT8_X1 : _pack_int8_x1 ,
332355 MOISTURE_UINT8_X1 : _pack_int8_x1 ,
333356 COUNT_UINT16_X1 : _pack_int16_x1 ,
0 commit comments