Skip to content

Commit be224e9

Browse files
Merge pull request #2 from hmoffatt/btx1
Add support for the BTX1.
2 parents d6de9bf + ada25c3 commit be224e9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Holman Python SDK
2-
[Holman CO3015](https://www.holmanindustries.com.au/products/bluetooth-tap-timer-co3015/) is a Bluetooth tap timer made by [Holman](https://www.holmanindustries.com.au/).
2+
[Holman CO3015](https://www.holmanindustries.com.au/products/bluetooth-tap-timer-co3015/)
3+
and [BTX1](https://www.holmanindustries.com.au/products/btx1-tap-mounted-smart-valve/) are Bluetooth tap timers made by [Holman](https://www.holmanindustries.com.au/).
34

45
The Holman Python SDK for Linux allows you to integrate your Holman(s) into any type of Linux application or script that can execute Python code.
56

holman/holman.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@ class TapTimer(gatt.Device):
8787
notified with all events
8888
"""
8989

90-
HOLMAN_SERVICE_UUID = '0a75f000-f9ad-467a-e564-3c19163ad543'
90+
HOLMAN_CO3015_SERVICE_UUID = '0a75f000-f9ad-467a-e564-3c19163ad543'
91+
HOLMAN_CO3011_SERVICE_UUID = 'c521f000-0d70-4d4f-8e43-40d84c50ab38' # model BTX1
9192
STATE_CHARACTERISTIC_UUID = '0000f004-0000-1000-8000-00805f9b34fb'
9293
MANUAL_CHARACTERISTIC_UUID = '0000f006-0000-1000-8000-00805f9b34fb'
9394

9495
SERVICE_UUIDS = [
95-
HOLMAN_SERVICE_UUID]
96+
HOLMAN_CO3015_SERVICE_UUID,
97+
HOLMAN_CO3011_SERVICE_UUID]
9698

9799
def __init__(self, mac_address, manager):
98100
"""
@@ -150,7 +152,7 @@ def services_resolved(self):
150152

151153
holman_service = next((
152154
service for service in self.services
153-
if service.uuid == self.HOLMAN_SERVICE_UUID), None)
155+
if service.uuid in self.SERVICE_UUIDS), None)
154156
if holman_service is None:
155157
if self.listener:
156158
# TODO: Use proper exception subclass

0 commit comments

Comments
 (0)