Skip to content
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

Update deprecated constants in const.py #20

Merged
merged 1 commit into from
Dec 31, 2023
Merged

Update deprecated constants in const.py #20

merged 1 commit into from
Dec 31, 2023

Conversation

hmmbob
Copy link
Contributor

@hmmbob hmmbob commented Dec 31, 2023

HA 2024.1.0b2 throws the following warnings:

2023-12-31 12:18:14.373 WARNING (MainThread) [homeassistant.const] TEMP_CELSIUS was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.380 WARNING (MainThread) [homeassistant.const] ELECTRIC_CURRENT_AMPERE was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricCurrent.AMPERE instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.384 WARNING (MainThread) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.389 WARNING (MainThread) [homeassistant.const] POWER_KILO_WATT was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.KILO_WATT instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.393 WARNING (MainThread) [homeassistant.const] TIME_MINUTES was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTime.MINUTES instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.399 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.404 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.407 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.412 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.418 WARNING (MainThread) [homeassistant.const] PRESSURE_BAR was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPressure.BAR instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.422 WARNING (MainThread) [homeassistant.const] TEMP_CELSIUS was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues
2023-12-31 12:18:14.426 WARNING (MainThread) [homeassistant.const] VOLUME_CUBIC_METERS was used from smartevse, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfVolume.CUBIC_METERS instead, please create a bug report at https://github.com/dingo35/ha-SmartEVSEv3/issues

With this PR, all of those are fixed. Tested locally, works fine.

Fixes #19

@hmmbob
Copy link
Contributor Author

hmmbob commented Dec 31, 2023

By the way, PRESSURE_BAR and VOLUME_CUBIC_METERS weren't actually used so I dropped those.

@dingo35
Copy link
Owner

dingo35 commented Dec 31, 2023

Thanks for your work!

I really like to keep stuff compatible, I assume adopting these changes would make the integration incompatible with older HA versions?

So we now have a choice, either clobber the code with "if HA VERSION then ... else ....",

Or just wait until december 2024, and then put this PR in.

Unless all 2023 versions are compatible with the new code?

@hmmbob
Copy link
Contributor Author

hmmbob commented Dec 31, 2023

Lemme check that. It's documented somewhere, but out for some groceries now. I'll get back to this!

@hmmbob
Copy link
Contributor Author

hmmbob commented Dec 31, 2023

They've been around for a year already, and all HA 2023.x versions should be compatible:

  • UnitOfElectricCurrent: HA 2023.1
  • UnitOfEnergy: 2022.11
  • UnitOfPower: 2022.11
  • UnitOfTemperature: 2022.11
  • UnitOfTime: HA 2023.1

Link to dev blog posts for 2022.11 and 2023.1

@dingo35 dingo35 merged commit cbcf936 into dingo35:main Dec 31, 2023
2 checks passed
@hmmbob hmmbob deleted the patch-1 branch December 31, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lots of depercation warnings on HA 2024.1.0b0
2 participants