mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 19:32:19 +01:00
preen
This commit is contained in:
@@ -140,32 +140,7 @@ select:
|
||||
ESP_LOGI("test", "Main Mode set to %s", x.c_str());
|
||||
id(mode_main).state = x;
|
||||
|
||||
# Test sensors for reading entity states
|
||||
sensor:
|
||||
- platform: template
|
||||
name: Switch State A
|
||||
id: switch_state_a
|
||||
device_id: device_a
|
||||
lambda: |-
|
||||
return id(light_device_a).state ? 1.0 : 0.0;
|
||||
update_interval: 0.5s
|
||||
|
||||
- platform: template
|
||||
name: Switch State B
|
||||
id: switch_state_b
|
||||
device_id: device_b
|
||||
lambda: |-
|
||||
return id(light_device_b).state ? 1.0 : 0.0;
|
||||
update_interval: 0.5s
|
||||
|
||||
- platform: template
|
||||
name: Switch State Main
|
||||
id: switch_state_main
|
||||
lambda: |-
|
||||
return id(light_main).state ? 1.0 : 0.0;
|
||||
update_interval: 0.5s
|
||||
|
||||
# Button to trigger preference save/restore test
|
||||
# Button to trigger preference logging test
|
||||
button:
|
||||
- platform: template
|
||||
name: Test Preferences
|
||||
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
import re
|
||||
|
||||
from aioesphomeapi import ButtonInfo, NumberInfo, SelectInfo, SensorInfo, SwitchInfo
|
||||
from aioesphomeapi import ButtonInfo, NumberInfo, SelectInfo, SwitchInfo
|
||||
import pytest
|
||||
|
||||
from .types import APIClientConnectedFactory, RunCompiledFunction
|
||||
@@ -95,16 +95,6 @@ async def test_multi_device_preferences(
|
||||
]
|
||||
assert len(selects) == 3, f"Expected 3 'Mode' selects, got {len(selects)}"
|
||||
|
||||
# Check sensors for switch state monitoring
|
||||
state_sensors = [
|
||||
e
|
||||
for e in entities
|
||||
if isinstance(e, SensorInfo) and "Switch State" in e.name
|
||||
]
|
||||
assert len(state_sensors) == 3, (
|
||||
f"Expected 3 'Switch State' sensors, got {len(state_sensors)}"
|
||||
)
|
||||
|
||||
# Find the test button entity to trigger preference logging
|
||||
buttons = [e for e in entities if isinstance(e, ButtonInfo)]
|
||||
test_button = next((b for b in buttons if b.name == "Test Preferences"), None)
|
||||
|
Reference in New Issue
Block a user