KoljaWindeler / kaco

custom integration for kaco solar inverter
15 stars 8 forks source link

Warnings from HA about obsolete data in the code. #13

Closed mickeyreg closed 1 month ago

mickeyreg commented 8 months ago

Version of the custom_component

0.5.1

Configuration


        "data": {
          "name": "Solar Power",
          "url": "192.168.32.127",
          "interval": 60,
          "kwh_interval": 180,
          "generator_voltage": true,
          "generator_current": true,
          "grid_voltage": true,
          "grid_current": true
        },

Describe the bug

The plugin works, but HA suggests that some changes in code are required.

Debug log


2024-03-12 13:15:04.278 WARNING (MainThread) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from kaco, 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/KoljaWindeler/kaco/issues
2024-03-12 13:15:04.281 WARNING (MainThread) [homeassistant.const] ELECTRIC_CURRENT_AMPERE was used from kaco, 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/KoljaWindeler/kaco/issues
2024-03-12 13:15:04.284 WARNING (MainThread) [homeassistant.const] ELECTRIC_POTENTIAL_VOLT was used from kaco, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricPotential.VOLT instead, please create a bug report at https://github.com/KoljaWindeler/kaco/issues
2024-03-12 13:15:04.287 WARNING (MainThread) [homeassistant.const] POWER_WATT was used from kaco, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.WATT instead, please create a bug report at https://github.com/KoljaWindeler/kaco/issues
2024-03-12 13:15:04.871 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'kaco' sets "data" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead at custom_components/kaco/__init__.py, line 28: config_entry.data = ensure_config(, please create a bug report at https://github.com/KoljaWindeler/kaco/issues
2024-03-12 13:15:04.874 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'kaco' sets "options" directly to update a config entry. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to use async_update_entry instead at custom_components/kaco/__init__.py, line 31: config_entry.options = config_entry.data, please create a bug report at https://github.com/KoljaWindeler/kaco/issues
2024-03-12 13:15:04.931 WARNING (MainThread) [homeassistant.const] DEVICE_CLASS_ENERGY was used from kaco, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.ENERGY instead, please create a bug report at https://github.com/KoljaWindeler/kaco/issues