mirror of
https://github.com/esphome/esphome.git
synced 2026-10-09 12:26:02 +00:00
[sendspin] Add the dynamic pairing code (#20349)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user