1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

[entity] Allow `device_id` to be blank on entities (#10217)

This commit is contained in:
Jesse Hills
2025-08-14 09:42:11 +12:00
committed by GitHub
parent fff66072d4
commit 6a8722f33e
5 changed files with 63 additions and 5 deletions

View File

@@ -55,6 +55,12 @@ sensor:
lambda: return 4.0;
update_interval: 0.1s
- platform: template
name: Living Room Sensor
device_id: ""
lambda: return 5.0;
update_interval: 0.1s
# Switches with the same name on different devices to test device_id lookup
switch:
# Switch with no device_id (defaults to 0)
@@ -96,3 +102,23 @@ switch:
- logger.log: "Turning on Test Switch on Motion Detector"
turn_off_action:
- logger.log: "Turning off Test Switch on Motion Detector"
- platform: template
name: Living Room Blank Switch
device_id: ""
id: test_switch_blank_living_room
optimistic: true
turn_on_action:
- logger.log: "Turning on Living Room Blank Switch"
turn_off_action:
- logger.log: "Turning off Living Room Blank Switch"
- platform: template
name: Living Room None Switch
device_id:
id: test_switch_none_living_room
optimistic: true
turn_on_action:
- logger.log: "Turning on Living Room None Switch"
turn_off_action:
- logger.log: "Turning off Living Room None Switch"