threshold_indicationthreshold

This commit is contained in:
Parker Brown 2025-02-18 06:52:05 +00:00 committed by GitHub
parent ef9d15cc14
commit 0c8280b831
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 13 deletions

View File

@ -75,9 +75,9 @@ SENSOR_DESCRIPTIONS = {
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
"status": AranetSensorEntityDescription( "status": AranetSensorEntityDescription(
key="threshold_indication", key="threshold",
translation_key="threshold_indication", translation_key="threshold",
name="Threshold Indication", name="threshold",
device_class=SensorDeviceClass.ENUM, device_class=SensorDeviceClass.ENUM,
options=[status.name.lower() for status in Color], options=[status.name.lower() for status in Color],
), ),

View File

@ -24,7 +24,7 @@
}, },
"entity": { "entity": {
"sensor": { "sensor": {
"threshold_indication": { "threshold": {
"state": { "state": {
"error": "Error", "error": "Error",
"green": "Green", "green": "Green",

View File

@ -214,12 +214,10 @@ async def test_sensors_aranet4(
assert interval_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "s" assert interval_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "s"
assert interval_sensor_attrs[ATTR_STATE_CLASS] == "measurement" assert interval_sensor_attrs[ATTR_STATE_CLASS] == "measurement"
status_sensor = hass.states.get("sensor.aranet4_12345_threshold_indication") status_sensor = hass.states.get("sensor.aranet4_12345_threshold")
status_sensor_attrs = status_sensor.attributes status_sensor_attrs = status_sensor.attributes
assert status_sensor.state == "green" assert status_sensor.state == "green"
assert ( assert status_sensor_attrs[ATTR_FRIENDLY_NAME] == "Aranet4 12345 Threshold"
status_sensor_attrs[ATTR_FRIENDLY_NAME] == "Aranet4 12345 Threshold Indication"
)
assert status_sensor_attrs[ATTR_OPTIONS] == ["error", "green", "yellow", "red"] assert status_sensor_attrs[ATTR_OPTIONS] == ["error", "green", "yellow", "red"]
# Check device context for the battery sensor # Check device context for the battery sensor
@ -299,13 +297,10 @@ async def test_sensors_aranetrn(
assert interval_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "s" assert interval_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "s"
assert interval_sensor_attrs[ATTR_STATE_CLASS] == "measurement" assert interval_sensor_attrs[ATTR_STATE_CLASS] == "measurement"
status_sensor = hass.states.get("sensor.aranetrn_12345_threshold_indication") status_sensor = hass.states.get("sensor.aranetrn_12345_threshold")
status_sensor_attrs = status_sensor.attributes status_sensor_attrs = status_sensor.attributes
assert status_sensor.state == "green" assert status_sensor.state == "green"
assert ( assert status_sensor_attrs[ATTR_FRIENDLY_NAME] == "AranetRn+ 12345 Threshold"
status_sensor_attrs[ATTR_FRIENDLY_NAME]
== "AranetRn+ 12345 Threshold Indication"
)
assert status_sensor_attrs[ATTR_OPTIONS] == ["error", "green", "yellow", "red"] assert status_sensor_attrs[ATTR_OPTIONS] == ["error", "green", "yellow", "red"]
# Check device context for the battery sensor # Check device context for the battery sensor