Skip to content

Commit 936024e

Browse files
bthome.py - more binary properties added
1 parent a94450e commit 936024e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

datatypes.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ Object id,Property,Data type,Factor,Example,Result,Unit
4040
0x27,running,uint8 (1 byte),2701,"0 (False = Not Running) 1 (True = Running)"
4141
0x28,safety,uint8 (1 byte),2800,"0 (False = Unsafe) 1 (True = Safe)"
4242
0x29,smoke,uint8 (1 byte),2901,"0 (False = Clear) 1 (True = Detected)"
43-
4443
0x2A,sound,uint8 (1 byte),2A00,"0 (False = Clear) 1 (True = Detected)"
4544
0x2B,tamper,uint8 (1 byte),2B00,"0 (False = Off) 1 (True = On)"
45+
4646
0x2C,vibration,uint8 (1 byte),2C01,"0 (False = Clear) 1 (True = Detected)"
4747
0x2D,window,uint8 (1 byte),2D01,"0 (False = Closed) 1 (True = Open)"
4848

src/bthome.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ class BTHome:
7878
RUNNING_BINARY = const(0x27) # 0 (False = Not Running) 1 (True = Running)
7979
SAFETY_BINARY = const(0x28) # 0 (False = Unsafe) 1 (True = Safe)
8080
SMOKE_BINARY = const(0x29) # 0 (False = Clear) 1 (True = Detected)
81+
SOUND_BINARY = const(0x2A) # 0 (False = Clear) 1 (True = Detected)
82+
TAMPER_BINARY = const(0x2B) # 0 (False = Off) 1 (True = On)
8183
HUMIDITY_UINT8_X1 = const(0x2E) # %
8284
MOISTURE_UINT8_X1 = const(0x2F) # %
8385
COUNT_UINT16_X1 = const(0x3D)
@@ -162,6 +164,8 @@ class BTHome:
162164
RUNNING_BINARY: "running", # 0x27
163165
SAFETY_BINARY: "safety", # 0x28
164166
SMOKE_BINARY: "smoke", # 0x29
167+
SOUND_BINARY: "sound", # 0x2A
168+
TAMPER_BINARY: "tamper", # 0x2B
165169
HUMIDITY_UINT8_X1: "humidity", # 0x2E
166170
MOISTURE_UINT8_X1: "moisture", # 0x2F
167171
COUNT_UINT16_X1: "count", # 0x3D
@@ -259,6 +263,8 @@ class BTHome:
259263
safety = False
260264
speed = 0
261265
smoke = False
266+
sound = False
267+
tamper = False
262268
temperature = 0
263269
text = ""
264270
timestamp = 0
@@ -386,6 +392,8 @@ def _pack_raw_text(self, object_id, value):
386392
RUNNING_BINARY: _pack_binary,
387393
SAFETY_BINARY: _pack_binary,
388394
SMOKE_BINARY: _pack_binary,
395+
SOUND_BINARY: _pack_binary,
396+
TAMPER_BINARY: _pack_binary,
389397
HUMIDITY_UINT8_X1: _pack_int8_x1,
390398
MOISTURE_UINT8_X1: _pack_int8_x1,
391399
COUNT_UINT16_X1: _pack_int16_x1,

0 commit comments

Comments
 (0)