mirror of
https://github.com/esphome/esphome.git
synced 2026-01-24 07:48:55 +00:00
Compare commits
2 Commits
integratio
...
legacy_id
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d67e9d0926 | ||
|
|
cfb61bc50a |
@@ -5,8 +5,6 @@
|
||||
// Once the API is considered stable, this warning will be removed.
|
||||
|
||||
#include "esphome/components/infrared/infrared.h"
|
||||
#include "esphome/components/remote_transmitter/remote_transmitter.h"
|
||||
#include "esphome/components/remote_receiver/remote_receiver.h"
|
||||
|
||||
namespace esphome::ir_rf_proxy {
|
||||
|
||||
|
||||
@@ -533,6 +533,17 @@ static void set_json_id(JsonObject &root, EntityBase *obj, const char *prefix, J
|
||||
|
||||
root[ESPHOME_F("id")] = id_buf;
|
||||
|
||||
// Add legacy_id for backward compatibility with third-party integrations
|
||||
// Old format: {prefix}-{object_id} (e.g., "cover-garage_door")
|
||||
// Remove before 2026.7.0 when object_id support is fully removed
|
||||
char legacy_buf[ESPHOME_DOMAIN_MAX_LEN + 1 + OBJECT_ID_MAX_LEN];
|
||||
char *lp = legacy_buf;
|
||||
memcpy(lp, prefix, prefix_len);
|
||||
lp += prefix_len;
|
||||
*lp++ = '-';
|
||||
obj->write_object_id_to(lp, sizeof(legacy_buf) - (lp - legacy_buf));
|
||||
root[ESPHOME_F("legacy_id")] = legacy_buf;
|
||||
|
||||
if (start_config == DETAIL_ALL) {
|
||||
root[ESPHOME_F("domain")] = prefix;
|
||||
root[ESPHOME_F("name")] = name;
|
||||
|
||||
18
tests/components/ir_rf_proxy/common-rx.yaml
Normal file
18
tests/components/ir_rf_proxy/common-rx.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
remote_receiver:
|
||||
id: ir_receiver
|
||||
pin: ${rx_pin}
|
||||
|
||||
# Test various hardware types with transmitter/receiver using infrared platform
|
||||
infrared:
|
||||
# Infrared receiver
|
||||
- platform: ir_rf_proxy
|
||||
id: ir_rx
|
||||
name: "IR Receiver"
|
||||
remote_receiver_id: ir_receiver
|
||||
|
||||
# RF 900MHz receiver
|
||||
- platform: ir_rf_proxy
|
||||
id: rf_900_rx
|
||||
name: "RF 900 Receiver"
|
||||
frequency: 900 MHz
|
||||
remote_receiver_id: ir_receiver
|
||||
19
tests/components/ir_rf_proxy/common-tx.yaml
Normal file
19
tests/components/ir_rf_proxy/common-tx.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
remote_transmitter:
|
||||
id: ir_transmitter
|
||||
pin: ${tx_pin}
|
||||
carrier_duty_percent: 50%
|
||||
|
||||
# Test various hardware types with transmitter/receiver using infrared platform
|
||||
infrared:
|
||||
# Infrared transmitter
|
||||
- platform: ir_rf_proxy
|
||||
id: ir_tx
|
||||
name: "IR Transmitter"
|
||||
remote_transmitter_id: ir_transmitter
|
||||
|
||||
# RF 433MHz transmitter
|
||||
- platform: ir_rf_proxy
|
||||
id: rf_433_tx
|
||||
name: "RF 433 Transmitter"
|
||||
frequency: 433 MHz
|
||||
remote_transmitter_id: ir_transmitter
|
||||
@@ -1,42 +1,7 @@
|
||||
network:
|
||||
|
||||
wifi:
|
||||
ssid: MySSID
|
||||
password: password1
|
||||
|
||||
api:
|
||||
|
||||
remote_transmitter:
|
||||
id: ir_transmitter
|
||||
pin: ${tx_pin}
|
||||
carrier_duty_percent: 50%
|
||||
|
||||
remote_receiver:
|
||||
id: ir_receiver
|
||||
pin: ${rx_pin}
|
||||
|
||||
# Test various hardware types with transmitter/receiver using infrared platform
|
||||
infrared:
|
||||
# Infrared transmitter
|
||||
- platform: ir_rf_proxy
|
||||
id: ir_tx
|
||||
name: "IR Transmitter"
|
||||
remote_transmitter_id: ir_transmitter
|
||||
|
||||
# Infrared receiver
|
||||
- platform: ir_rf_proxy
|
||||
id: ir_rx
|
||||
name: "IR Receiver"
|
||||
remote_receiver_id: ir_receiver
|
||||
|
||||
# RF 433MHz transmitter
|
||||
- platform: ir_rf_proxy
|
||||
id: rf_433_tx
|
||||
name: "RF 433 Transmitter"
|
||||
frequency: 433 MHz
|
||||
remote_transmitter_id: ir_transmitter
|
||||
|
||||
# RF 900MHz receiver
|
||||
- platform: ir_rf_proxy
|
||||
id: rf_900_rx
|
||||
name: "RF 900 Receiver"
|
||||
frequency: 900 MHz
|
||||
remote_receiver_id: ir_receiver
|
||||
|
||||
7
tests/components/ir_rf_proxy/test-rx.esp32-idf.yaml
Normal file
7
tests/components/ir_rf_proxy/test-rx.esp32-idf.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
rx: !include common-rx.yaml
|
||||
7
tests/components/ir_rf_proxy/test-rx.esp8266-ard.yaml
Normal file
7
tests/components/ir_rf_proxy/test-rx.esp8266-ard.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
rx: !include common-rx.yaml
|
||||
7
tests/components/ir_rf_proxy/test-rx.rp2040-ard.yaml
Normal file
7
tests/components/ir_rf_proxy/test-rx.rp2040-ard.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
rx: !include common-rx.yaml
|
||||
7
tests/components/ir_rf_proxy/test-tx.esp32-idf.yaml
Normal file
7
tests/components/ir_rf_proxy/test-tx.esp32-idf.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
tx: !include common-tx.yaml
|
||||
7
tests/components/ir_rf_proxy/test-tx.esp8266-ard.yaml
Normal file
7
tests/components/ir_rf_proxy/test-tx.esp8266-ard.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
tx: !include common-tx.yaml
|
||||
7
tests/components/ir_rf_proxy/test-tx.rp2040-ard.yaml
Normal file
7
tests/components/ir_rf_proxy/test-tx.rp2040-ard.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
tx: !include common-tx.yaml
|
||||
8
tests/components/ir_rf_proxy/test.bk72xx-ard.yaml
Normal file
8
tests/components/ir_rf_proxy/test.bk72xx-ard.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
rx: !include common-rx.yaml
|
||||
tx: !include common-tx.yaml
|
||||
@@ -2,4 +2,7 @@ substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
<<: !include common.yaml
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
rx: !include common-rx.yaml
|
||||
tx: !include common-tx.yaml
|
||||
|
||||
@@ -2,4 +2,7 @@ substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
<<: !include common.yaml
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
rx: !include common-rx.yaml
|
||||
tx: !include common-tx.yaml
|
||||
|
||||
@@ -2,4 +2,7 @@ substitutions:
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
|
||||
<<: !include common.yaml
|
||||
packages:
|
||||
common: !include common.yaml
|
||||
rx: !include common-rx.yaml
|
||||
tx: !include common-tx.yaml
|
||||
|
||||
Reference in New Issue
Block a user