Repository navigation
feat(mqtt): standalone MQTT exporter, auto-discovery, and live workout streaming (#14) - #147
Open
foureight84 wants to merge 2 commits into
Open
foureight84 wants to merge 2 commits into
foureight84 wants to merge 2 commits into
Conversation
…rkout streaming (#14)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #14
(Stacked on #144 /
fix/batch-2026-11-12for EN/RU string resources and worker hooks)Summary
Adds a standalone, broker-agnostic MQTT 3.1.1 exporter (
Settings → MQTT) for pushing ring health metrics, sleep sessions, daily activity, and live workout / spot measurements to any MQTT broker (Mosquitto, EMQX, HiveMQ, etc.), with consolidated JSON state topics and retained MQTT auto-discovery config publishing.Key Features
MqttProtocol,MqttClient,MqttSessionPool):Socket/SSLSocketwith"HTTPS"hostname verification, QoS 0 & QoS 1PUBLISH/PUBACK,PINGREQ/PINGRESP, 30 s idle connection pooling).EncryptedSharedPreferences(pulseloop_secure); settings persisted inpulseloop_prefs(pulseloop.mqtt.v1).15 / 30 / 60 / 120 min, clamped15–720 min) wired intoRingSyncWorkerandScheduledSpo2Worker(plus debouncedMqttExportWorkerafter ring syncs and spot measurements).MqttLivePublisher): coalesces rapid updates to~5 sover a persistent pooled socket and triggers an immediate full snapshot when a workout ends.battery,heart_rate,resting_heart_rate,spo2,hrv,stressgated by real hardware support#67,temperature,blood_pressure_systolic,blood_pressure_diastolic,blood_sugar,respiratory_rategated by#103,vo2_max,steps,calories,distance,active_minutes,sleep_duration,sleep_score,sleep_deep,sleep_light,sleep_rem,sleep_awake,workout_active,workout_type,workout_duration,last_sync), with per-sensor toggles inSettings → MQTT.<base_topic>/<device_slug>/state) and retained auto-discovery configs (<discovery_prefix>/<component>/pulseloop_<mac_or_id_hex>/<sensor_key>/config).source NOT IN ('demo', 'mock')).Settings → MQTTscreen with Test Connection, Publish Now, and Clear Retained Topics.values-ru/strings.xml) localization.docs/mqtt.md.Verification
MqttProtocolTest(18),MqttDiscoveryTest(13),MqttPrefsStoreTest(8) + full:app:testDebugUnitTestsuite (1,753passed,0failures).LiveMosquittoBrokerTest) against Eclipse Mosquitto 2.1.2 (publish, retained discovery, clear retained topics, and username/passwordCONNACKauth).Settings → MQTT→ Test Connection, Publish Now, and Clear Retained Topics verified viamosquitto_sub).