ultimatedarktower 2.5.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.0.0] - 2026-03-24
10
+
11
+ ### Changed
12
+
13
+ - **`onBatteryLevelNotify` now fires on every battery response** — The callback is no longer gated by battery logging settings, ensuring internal battery state and UI indicators always stay current regardless of log configuration.
14
+ - **Renamed battery notification properties to battery logging properties** — `batteryNotifyEnabled` → `batteryLogEnabled`, `batteryNotifyFrequency` → `batteryLogFrequency`, `batteryNotifyOnValueChangeOnly` → `batteryLogOnChangeOnly`. The new names clarify that these properties control the library's internal log output, not the `onBatteryLevelNotify` callback.
15
+ - **`lights()` now sends a single command instead of per-light commands** — Previously sent individual `setLEDStateful` commands for each light (up to 24 commands), which could overflow the tower's buffer. Now accumulates all light changes into one state packet sent as a single command.
16
+
17
+ ### Fixed
18
+
19
+ - **Battery indicator not updating when battery logging set to NONE** — The Tower Status battery display now always updates regardless of the battery logging setting.
20
+ - **Battery `[RCVD]` log lines ignoring "Changes" filter** — The generic `[UDT][BLE][RCVD] BATTERY_READING` log line was not respecting `batteryLogOnChangeOnly`. Battery responses now skip the generic RCVD log and are logged exclusively by the dedicated battery logging block, which correctly respects all three logging properties.
21
+ - **Ledge and base light effects not looping** — Effects like "breathe" played once and faded away on ledge and base lights because their `loop` flag was hardcoded to `false`. All light types now set `loop` based on whether the effect is active (`effect !== LIGHT_EFFECTS.off`), matching the behaviour of `allLightsOn()`.
22
+
23
+ ### Added
24
+
25
+ - **Battery logging properties documented in API_REFERENCE.md** — `batteryLogEnabled`, `batteryLogFrequency`, and `batteryLogOnChangeOnly` are now documented with descriptions, types, defaults, and usage examples.
26
+
9
27
  ## [2.5.0] - 2026-03-23
10
28
 
11
29
  ### Added
@@ -16,7 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
16
34
 
17
35
  ### Changed
18
36
 
19
- - **Improved seal management documentation** — Reference.md now explains that seals are physical plastic covers on the tower (12 total), that seal state is tracked purely in software (not by firmware), and documents all new seal state management APIs.
37
+ - **Improved seal management documentation** — API_REFERENCE.md now explains that seals are physical plastic covers on the tower (12 total), that seal state is tracked purely in software (not by firmware), and documents all new seal state management APIs.
20
38
 
21
39
  ## [2.4.0] - 2026-03-19
22
40
 
package/README.md CHANGED
@@ -12,51 +12,51 @@ I have spent many hours reverse engineering the Tower's protocol in order to cre
12
12
 
13
13
  ## Table of Contents
14
14
 
15
- - [UltimateDarkTower](#ultimatedarktower)
16
- - [Table of Contents](#table-of-contents)
17
- - [Features](#features)
18
- - [Live Examples](#live-examples)
19
- - [Installation](#installation)
20
- - [Browser / Web Applications](#browser--web-applications)
21
- - [Node.js Applications](#nodejs-applications)
22
- - [Quick Start](#quick-start)
23
- - [Browser (auto-detected)](#browser-auto-detected)
24
- - [Node.js (auto-detected)](#nodejs-auto-detected)
25
- - [Explicit Platform Selection](#explicit-platform-selection)
26
- - [Custom Adapter (React Native, etc.)](#custom-adapter-react-native-etc)
27
- - [Documentation](#documentation)
28
- - [📖 Complete API Reference](#-complete-api-reference)
29
- - [Key Topics Covered:](#key-topics-covered)
30
- - [Development](#development)
31
- - [Building and Testing](#building-and-testing)
32
- - [Project Structure](#project-structure)
33
- - [Platform Support](#platform-support)
34
- - [Built-in Support (auto-detected)](#built-in-support-auto-detected)
35
- - [Custom Adapter Support](#custom-adapter-support)
36
- - [Browser Support](#browser-support)
37
- - [Known Issues](#known-issues)
38
- - [Community](#community)
15
+ - [UltimateDarkTower](#ultimatedarktower)
16
+ - [Table of Contents](#table-of-contents)
17
+ - [Features](#features)
18
+ - [Live Examples](#live-examples)
19
+ - [Installation](#installation)
20
+ - [Browser / Web Applications](#browser--web-applications)
21
+ - [Node.js Applications](#nodejs-applications)
22
+ - [Quick Start](#quick-start)
23
+ - [Browser (auto-detected)](#browser-auto-detected)
24
+ - [Node.js (auto-detected)](#nodejs-auto-detected)
25
+ - [Explicit Platform Selection](#explicit-platform-selection)
26
+ - [Custom Adapter (React Native, etc.)](#custom-adapter-react-native-etc)
27
+ - [Documentation](#documentation)
28
+ - [📖 Complete API Reference](#-complete-api-reference)
29
+ - [Key Topics Covered:](#key-topics-covered)
30
+ - [Development](#development)
31
+ - [Building and Testing](#building-and-testing)
32
+ - [Project Structure](#project-structure)
33
+ - [Platform Support](#platform-support)
34
+ - [Built-in Support (auto-detected)](#built-in-support-auto-detected)
35
+ - [Custom Adapter Support](#custom-adapter-support)
36
+ - [Browser Support](#browser-support)
37
+ - [Known Issues](#known-issues)
38
+ - [Community](#community)
39
39
 
40
40
  ## Features
41
41
 
42
- - **Multi-Platform Bluetooth** - Works in browsers (Web Bluetooth), Node.js (`@stoprocent/noble`), Electron, and React Native via custom adapters
43
- - **Bluetooth Connection Management** - Reliable connection with automatic monitoring and disconnect detection
44
- - **Tower Control** - Complete control over lights, sounds, and drum rotation
45
- - **Game State Tracking** - Track glyph positions, broken seals, and skull counts
46
- - **Event System** - Callback-based event handling for tower events
47
- - **ESM + CJS** - Ships both an ES Module build and a CommonJS build; works with `import` and `require` without configuration
48
- - **TypeScript Support** - Full TypeScript definitions and type safety
49
- - **Comprehensive Logging** - Multi-output logging system for debugging
50
- - **Battery Monitoring** - Real-time battery level tracking and low battery warnings
51
- - **Extensible Adapter Pattern** - Implement `IBluetoothAdapter` for custom platforms
42
+ - **Multi-Platform Bluetooth** - Works in browsers (Web Bluetooth), Node.js (`@stoprocent/noble`), Electron, and React Native via custom adapters
43
+ - **Bluetooth Connection Management** - Reliable connection with automatic monitoring and disconnect detection
44
+ - **Tower Control** - Complete control over lights, sounds, and drum rotation
45
+ - **Game State Tracking** - Track glyph positions, broken seals, and skull counts
46
+ - **Event System** - Callback-based event handling for tower events
47
+ - **ESM + CJS** - Ships both an ES Module build and a CommonJS build; works with `import` and `require` without configuration
48
+ - **TypeScript Support** - Full TypeScript definitions and type safety
49
+ - **Comprehensive Logging** - Multi-output logging system for debugging
50
+ - **Battery Monitoring** - Real-time battery level tracking and low battery warnings
51
+ - **Extensible Adapter Pattern** - Implement `IBluetoothAdapter` for custom platforms
52
52
 
53
53
  ## Live Examples
54
54
 
55
55
  Try the library in action! Just power on your Tower and visit:
56
56
 
57
- - **[Tower Controller](https://chessmess.github.io/UltimateDarkTower/dist/examples/controller/TowerController.html)** - Replicates official app functionality and gives examples of library functionality.
57
+ - **[Tower Controller](https://chessmess.github.io/UltimateDarkTower/dist/examples/controller/TowerController.html)** - Replicates official app functionality and gives examples of library functionality.
58
58
 
59
- - **[Tower Game](https://chessmess.github.io/UltimateDarkTower/dist/examples/game/TowerGame.html)** - "The Tower's Challenge" - a complete game using just the tower
59
+ - **[Tower Game](https://chessmess.github.io/UltimateDarkTower/dist/examples/game/TowerGame.html)** - "The Tower's Challenge" - a complete game using just the tower
60
60
 
61
61
  _Requires Web Bluetooth support (Chrome, Edge, Samsung Internet). For iOS, use the [Bluefy app](https://apps.apple.com/us/app/bluefy-web-ble-browser/id1492822055)._
62
62
 
@@ -119,7 +119,7 @@ import UltimateDarkTower, { IBluetoothAdapter } from 'ultimatedarktower';
119
119
 
120
120
  class MyCustomAdapter implements IBluetoothAdapter {
121
121
  // Implement all IBluetoothAdapter methods
122
- // See Reference.md for the full interface
122
+ // See API_REFERENCE.md for the full interface
123
123
  }
124
124
 
125
125
  const tower = new UltimateDarkTower({ adapter: new MyCustomAdapter() });
@@ -127,22 +127,22 @@ const tower = new UltimateDarkTower({ adapter: new MyCustomAdapter() });
127
127
 
128
128
  ## Documentation
129
129
 
130
- ### 📖 [Complete API Reference](Reference.md)
130
+ ### 📖 [Complete API Reference](API_REFERENCE.md)
131
131
 
132
132
  Comprehensive documentation with TypeScript examples, best practices, and troubleshooting guides.
133
133
 
134
134
  ### Key Topics Covered:
135
135
 
136
- - **Multi-Platform Setup** - Configuration for Web, Node.js, Electron, and React Native
137
- - **Connection Management** - Connecting, disconnecting, and monitoring connection health
138
- - **Bluetooth Adapters** - Custom adapter interface for extending platform support
139
- - **Tower Control** - Detailed coverage of all tower commands (lights, sounds, rotation)
140
- - **Glyph System** - Automatic tracking of glyph positions as towers rotate
141
- - **Seal Management** - Breaking seals and tracking game state
142
- - **Event Handling** - Callback system for tower events
143
- - **Logging System** - Multi-output logging for debugging and monitoring
144
- - **Best Practices** - Performance tips, error handling, and common patterns
145
- - **Troubleshooting** - Solutions for common issues and debugging techniques
136
+ - **Multi-Platform Setup** - Configuration for Web, Node.js, Electron, and React Native
137
+ - **Connection Management** - Connecting, disconnecting, and monitoring connection health
138
+ - **Bluetooth Adapters** - Custom adapter interface for extending platform support
139
+ - **Tower Control** - Detailed coverage of all tower commands (lights, sounds, rotation)
140
+ - **Glyph System** - Automatic tracking of glyph positions as towers rotate
141
+ - **Seal Management** - Breaking seals and tracking game state
142
+ - **Event Handling** - Callback system for tower events
143
+ - **Logging System** - Multi-output logging for debugging and monitoring
144
+ - **Best Practices** - Performance tips, error handling, and common patterns
145
+ - **Troubleshooting** - Solutions for common issues and debugging techniques
146
146
 
147
147
  ## Integration Testing
148
148
 
@@ -154,9 +154,9 @@ To run the calibration integration test:
154
154
  npm run test:integration
155
155
  ```
156
156
 
157
- - This will connect to the tower, perform a full calibration sequence, and print the resulting glyph positions.
158
- - The test will fail if the tower is not available or calibration does not complete within 60 seconds.
159
- - Integration tests are not included in automated test runs or npm publish.
157
+ - This will connect to the tower, perform a full calibration sequence, and print the resulting glyph positions.
158
+ - The test will fail if the tower is not available or calibration does not complete within 60 seconds.
159
+ - Integration tests are not included in automated test runs or npm publish.
160
160
 
161
161
  ### Lights Integration Test
162
162
 
@@ -164,9 +164,9 @@ The lights integration test validates the `allLightsOn` and `allLightsOff` API m
164
164
 
165
165
  **Test steps:**
166
166
 
167
- - Turns all 24 LEDs on (solid effect) for 2 seconds
168
- - Turns all 24 LEDs on (breathe effect) for 3 seconds
169
- - Turns all 24 LEDs off
167
+ - Turns all 24 LEDs on (solid effect) for 2 seconds
168
+ - Turns all 24 LEDs on (breathe effect) for 3 seconds
169
+ - Turns all 24 LEDs off
170
170
 
171
171
  **How to run:**
172
172
 
@@ -176,21 +176,21 @@ npm run test:integration:lights
176
176
 
177
177
  **Prerequisites:**
178
178
 
179
- - Tower must be powered on and in Bluetooth range
180
- - `@stoprocent/noble` must be installed
179
+ - Tower must be powered on and in Bluetooth range
180
+ - `@stoprocent/noble` must be installed
181
181
 
182
182
  **Visual verification:**
183
183
 
184
- - All lights on (solid) for 2 seconds
185
- - All lights breathe effect for 3 seconds
186
- - All lights off
184
+ - All lights on (solid) for 2 seconds
185
+ - All lights breathe effect for 3 seconds
186
+ - All lights off
187
187
 
188
- See [Reference.md](Reference.md) for API details on `allLightsOn` and `allLightsOff`.
188
+ See [API_REFERENCE.md](API_REFERENCE.md) for API details on `allLightsOn` and `allLightsOff`.
189
189
 
190
190
  **Prerequisites:**
191
191
 
192
- - Tower must be powered on and in Bluetooth range
193
- - `@stoprocent/noble` must be installed (it is a peer dependency)
192
+ - Tower must be powered on and in Bluetooth range
193
+ - `@stoprocent/noble` must be installed (it is a peer dependency)
194
194
 
195
195
  ## Development
196
196
 
@@ -271,10 +271,10 @@ examples/
271
271
 
272
272
  ## Known Issues
273
273
 
274
- - **Sounds** - Sounds show as command complete which is true even though the sound itself has not completed. This is just the way the tower works. I'll have to add time lengths to each at some point, just don't use the command complete response as a way of thinking the associated sound has finished playing and you can play another sound.
275
- - **Light Sequences** - Same as sound for lights that play for a duration.
274
+ - **Sounds** - Sounds show as command complete which is true even though the sound itself has not completed. This is just the way the tower works. I'll have to add time lengths to each at some point, just don't use the command complete response as a way of thinking the associated sound has finished playing and you can play another sound.
275
+ - **Light Sequences** - Same as sound for lights that play for a duration.
276
276
 
277
- > See [Reference.md](Reference.md) for performance best practices and workarounds.
277
+ > See [API_REFERENCE.md](API_REFERENCE.md) for performance best practices and workarounds.
278
278
 
279
279
  ## Community
280
280