Rename Particulate matter sensors to PM (#91384)
This commit is contained in:
parent
fc8c5f1bbd
commit
ce16d8eeac
10 changed files with 67 additions and 105 deletions
|
@ -87,18 +87,15 @@ async def test_luftdaten_sensors(
|
|||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfPressure.PA
|
||||
assert ATTR_ICON not in state.attributes
|
||||
|
||||
entry = entity_registry.async_get("sensor.sensor_12345_particulate_matter_10_mm")
|
||||
entry = entity_registry.async_get("sensor.sensor_12345_pm10")
|
||||
assert entry
|
||||
assert entry.device_id
|
||||
assert entry.unique_id == "12345_P1"
|
||||
|
||||
state = hass.states.get("sensor.sensor_12345_particulate_matter_10_mm")
|
||||
state = hass.states.get("sensor.sensor_12345_pm10")
|
||||
assert state
|
||||
assert state.state == "8.5"
|
||||
assert (
|
||||
state.attributes.get(ATTR_FRIENDLY_NAME)
|
||||
== "Sensor 12345 Particulate matter 10 μm"
|
||||
)
|
||||
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Sensor 12345 PM10"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.PM10
|
||||
assert state.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT
|
||||
assert (
|
||||
|
@ -107,18 +104,15 @@ async def test_luftdaten_sensors(
|
|||
)
|
||||
assert ATTR_ICON not in state.attributes
|
||||
|
||||
entry = entity_registry.async_get("sensor.sensor_12345_particulate_matter_2_5_mm")
|
||||
entry = entity_registry.async_get("sensor.sensor_12345_pm2_5")
|
||||
assert entry
|
||||
assert entry.device_id
|
||||
assert entry.unique_id == "12345_P2"
|
||||
|
||||
state = hass.states.get("sensor.sensor_12345_particulate_matter_2_5_mm")
|
||||
state = hass.states.get("sensor.sensor_12345_pm2_5")
|
||||
assert state
|
||||
assert state.state == "4.07"
|
||||
assert (
|
||||
state.attributes.get(ATTR_FRIENDLY_NAME)
|
||||
== "Sensor 12345 Particulate matter 2.5 μm"
|
||||
)
|
||||
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Sensor 12345 PM2.5"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.PM25
|
||||
assert state.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT
|
||||
assert (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue