-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix NumberEntity backward compatibility
- Loading branch information
Showing
4 changed files
with
58 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from homeassistant.components.button import ButtonEntity | ||
from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode | ||
from homeassistant.components.fan import FanEntityFeature, FanEntity | ||
from homeassistant.components.light import ColorMode, LightEntityFeature | ||
from homeassistant.components.sensor import ( | ||
SensorEntity, | ||
SensorDeviceClass, | ||
SensorStateClass, | ||
) | ||
from homeassistant.const import ( | ||
EntityCategory, | ||
UnitOfElectricCurrent, | ||
UnitOfElectricPotential, | ||
UnitOfEnergy, | ||
UnitOfPower, | ||
UnitOfTemperature, | ||
) | ||
|
||
|
||
def test_2021_9_0(): | ||
sensor = SensorEntity() | ||
assert sensor.native_value is None | ||
assert sensor.native_unit_of_measurement is None | ||
|
||
|
||
def test_2021_12_0(): | ||
assert ButtonEntity | ||
assert EntityCategory | ||
assert FanEntity().percentage is 0 | ||
assert SensorDeviceClass | ||
assert SensorStateClass | ||
|
||
|
||
def test_2022_5_0(): | ||
assert ClimateEntityFeature | ||
assert HVACMode | ||
assert FanEntityFeature | ||
assert ColorMode | ||
assert LightEntityFeature | ||
|
||
|
||
def test_2022_11_0(): | ||
assert UnitOfEnergy | ||
assert UnitOfPower | ||
assert UnitOfTemperature | ||
|
||
|
||
def test_2023_1_0(): | ||
assert UnitOfElectricCurrent | ||
assert UnitOfElectricPotential | ||
|
||
|
||
def test_2024_1_cached_properties(): | ||
pass |