[sendspin] Add the dynamic pairing code (#20349)

This commit is contained in:
Kevin Ahrendt
2026-10-08 13:36:12 -04:00
committed by GitHub
parent 4b2f8122e3
commit 9c79fa7430
13 changed files with 271 additions and 19 deletions
+11
View File
@@ -7,6 +7,9 @@ sendspin:
manufacturer: Test Manufacturer
model: Test Model
firmware_version: 1.2.3
# No static_pairing_code here: the on_display_pairing_code automation below makes
# this a dynamic-pairing-code device, and validation rejects both together.
# common-pairing.yaml covers the static-code build.
on_open_pairing_window:
then:
- logger.log: "Pairing window requested"
@@ -16,6 +19,14 @@ sendspin:
then:
- logger.log: "Pairing window prompt dismissed"
- sendspin.cancel_pairing_window:
on_display_pairing_code:
then:
- logger.log:
format: "Pairing code: %s"
args: ["code.c_str()"]
on_clear_pairing_code:
then:
- logger.log: "Pairing code cleared"
on_pairing_succeeded:
then:
- logger.log:
@@ -0,0 +1,17 @@
# The pairing code text sensor on its own, with no metadata text sensor to pull in the
# metadata role. This is the build where USE_SENDSPIN_METADATA is undefined while the text
# sensor platform is still compiled, which is guarded separately in sendspin_text_sensor.{h,cpp}.
#
# Deliberately does not include common.yaml: that file pulls in the shared hub package, and
# the point here is the narrower configuration. sendspin depends on network, so the interface
# has to be declared locally instead.
wifi:
ap:
sendspin:
id: sendspin_hub_id
text_sensor:
- platform: sendspin
name: "Pairing Code"
type: pairing_code
@@ -14,3 +14,7 @@ text_sensor:
- platform: sendspin
name: "Album Artist"
type: album_artist
- platform: sendspin
name: "Pairing Code"
type: pairing_code
entity_category: diagnostic
@@ -0,0 +1,2 @@
packages:
sendspin: !include common-text_sensor-pairing.yaml