mirror of
https://github.com/esphome/esphome.git
synced 2026-07-11 01:15:33 +00:00
c0873973c1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
15 lines
360 B
Python
15 lines
360 B
Python
"""Tests for the sensor component."""
|
|
|
|
|
|
def test_sensor_device_class_set(generate_main):
|
|
"""
|
|
When the device_class of sensor is set in the yaml file, it should be registered in main
|
|
"""
|
|
# Given
|
|
|
|
# When
|
|
main_cpp = generate_main("tests/component_tests/sensor/test_sensor.yaml")
|
|
|
|
# Then
|
|
assert "s_1->configure_entity(" in main_cpp
|