-
-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔧 replace deprecated constants #1461
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven’t tried it yet but looks good to me.
@@ -92,7 +92,7 @@ def update_bind_sensor(self): | |||
if num is not None: | |||
cls = sta.attributes.get(ATTR_DEVICE_CLASS) | |||
unit = sta.attributes.get(ATTR_UNIT_OF_MEASUREMENT) | |||
if cls == SensorDeviceClass.TEMPERATURE.value or unit in [TEMP_CELSIUS, TEMP_KELVIN, TEMP_FAHRENHEIT]: | |||
if cls == SensorDeviceClass.TEMPERATURE.value or unit in [UnitOfTemperature.CELSIUS, UnitOfTemperature.KELVIN, UnitOfTemperature.FAHRENHEIT]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required v2022.11.0
'electric_current': ELECTRIC_CURRENT_AMPERE, | ||
'voltage': ELECTRIC_POTENTIAL_VOLT, | ||
'power_consumption': UnitOfEnergy.WATT_HOUR, | ||
'electric_current': UnitOfElectricCurrent.AMPERE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required v2023.1.0
@@ -108,7 +108,7 @@ def should_poll(self): | |||
@property | |||
def source_type(self): | |||
"""Return the source type, eg gps or router, of the device.""" | |||
return SOURCE_TYPE_GPS | |||
return SourceType.GPS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required v2022.9.0
Fix error in HA 2024.1
see https://developers.home-assistant.io/blog/2023/12/19/constant-deprecation
This increase the minimum HA version requirement to 2022.11