Skip to content

Commit 1de6f67

Browse files
committed
ble.lwp3.bytecodes: add HubProperty.VOLUME
This property is present on Mario hubs.
1 parent 70e0793 commit 1de6f67

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
### Added
10+
- Added `VOLUME` to `ble.lwp3.bytecodes.HubProperty` enum.
11+
712
## [1.0.0-alpha.14] - 2021-08-27
813

914
## Changed

pybricksdev/ble/lwp3/bytecodes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ class HubProperty(IntEnum):
422422
HW_NET_FAMILY = 0x0F
423423
"""Hardware network family."""
424424

425+
VOLUME = 0x12
426+
"""Sound volume level."""
427+
425428

426429
@unique
427430
class HubPropertyOperation(IntEnum):

pybricksdev/ble/lwp3/messages.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ class _HubPropertyType(NamedTuple):
164164
HubProperty.BDADDR: _HubPropertyType(BluetoothAddress, "6s"),
165165
HubProperty.BOOTLOADER_BDADDR: _HubPropertyType(BluetoothAddress, "6s"),
166166
HubProperty.HW_NET_FAMILY: _HubPropertyType(HwNetFamily, "B"),
167+
HubProperty.VOLUME: _HubPropertyType(int, "B"),
167168
}
168169

169170
Op = HubPropertyOperation
@@ -207,6 +208,14 @@ class _HubPropertyType(NamedTuple):
207208
HubProperty.BDADDR: [Op.REQUEST_UPDATE, Op.UPDATE],
208209
HubProperty.BOOTLOADER_BDADDR: [Op.REQUEST_UPDATE, Op.UPDATE],
209210
HubProperty.HW_NET_FAMILY: [Op.SET, Op.REQUEST_UPDATE, Op.UPDATE],
211+
HubProperty.VOLUME: [
212+
Op.SET,
213+
Op.ENABLE_UPDATES,
214+
Op.DISABLE_UPDATES,
215+
Op.RESET,
216+
Op.REQUEST_UPDATE,
217+
Op.UPDATE,
218+
],
210219
}
211220

212221
del Op

0 commit comments

Comments
 (0)