Add speed to SensorDeviceClass (#77953)
* Add speed to SensorDeviceClass * Adjust recorder * Adjust tests * Adjust sensor UNIT_CONVERTERS * Add tests * Add websocket tests * Update strings.json
This commit is contained in:
parent
7ead77eea6
commit
7c448416e1
11 changed files with 75 additions and 0 deletions
|
@ -16,6 +16,10 @@ from homeassistant.const import (
|
|||
PRESSURE_INHG,
|
||||
PRESSURE_KPA,
|
||||
PRESSURE_MMHG,
|
||||
SPEED_INCHES_PER_HOUR,
|
||||
SPEED_KILOMETERS_PER_HOUR,
|
||||
SPEED_MILES_PER_HOUR,
|
||||
SPEED_MILLIMETERS_PER_DAY,
|
||||
STATE_UNKNOWN,
|
||||
TEMP_CELSIUS,
|
||||
TEMP_FAHRENHEIT,
|
||||
|
@ -520,6 +524,31 @@ async def test_custom_unit(
|
|||
1000,
|
||||
SensorDeviceClass.PRESSURE,
|
||||
),
|
||||
# Speed
|
||||
(
|
||||
SPEED_KILOMETERS_PER_HOUR,
|
||||
SPEED_MILES_PER_HOUR,
|
||||
SPEED_MILES_PER_HOUR,
|
||||
100,
|
||||
62,
|
||||
SensorDeviceClass.SPEED,
|
||||
),
|
||||
(
|
||||
SPEED_MILLIMETERS_PER_DAY,
|
||||
SPEED_INCHES_PER_HOUR,
|
||||
SPEED_INCHES_PER_HOUR,
|
||||
78,
|
||||
0.13,
|
||||
SensorDeviceClass.SPEED,
|
||||
),
|
||||
(
|
||||
SPEED_KILOMETERS_PER_HOUR,
|
||||
"peer_distance",
|
||||
SPEED_KILOMETERS_PER_HOUR,
|
||||
100,
|
||||
100,
|
||||
SensorDeviceClass.SPEED,
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_custom_unit_change(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue