dotKrad / hass-fpl

FPL Component for Home Assistant
MIT License
40 stars 20 forks source link

Updating all references to deprecation warnings for 2025.1 #50

Open tekHudson opened 5 months ago

tekHudson commented 5 months ago

I recent installed this and had a ton of warnings. First time in Python, please check my work thoroughly.

tekHudson commented 5 months ago

Also can't figure out how to use Dev Containers. Would love it if someone could show me the ropes.

mattbratt commented 5 months ago

Thanks for your contribution! Good to see some action.

tekHudson commented 5 months ago

Well, first time contributing to anything from Home Assistant as I'm rather new, and my first time working in python, even though I've been coding for years. As the repository has been required for so long hopefully someone is willing to take the time to look at my work and maybe , they actually deem it worthy

GitittomeNow commented 4 months ago

Is there a way I could help test? What’s needed to get this committed?

tekHudson commented 4 months ago

@GitittomeNow I don't know. Having heard nothing from @dotKrad I don't know how if the owner of the repo isn't active. I'm gonna install on my local HA and test it.

I also formed and started a rewrite using a template from one of the HA core contributors, but it's my first python project so much more of a learning curve than just editing a couple files.

tekHudson commented 4 months ago

My biggest issue currently is i have net metering (cause I have solar) and am getting issue with the negative values returned. I think i need to add another sensor to sum something, /shrug

GitittomeNow commented 4 months ago

I’d be happy to help in someway! I’m an IT engineer but have not done coding yet. I too have net metering along with batteries. For me, everything shows properly in an add-on called “Power Flow Card Plus” but not the Home Assistant native energy dashboard. Also, the current version gives all kinds of errors each day, which is annoying.

MrSco commented 3 months ago

I tested this changes and it seems to get rid of the deprecation warnings. I also updated https://github.com/dotKrad/hass-fpl/blob/master/custom_components/fpl/sensor_HourlyUsageSensor.py in the same way.

Also there was a warning about async_add_job() in init.py ...

https://github.com/dotKrad/hass-fpl/blob/93a58ef58c155c92ad6e02922cd2df89f5e7e480/custom_components/fpl/__init__.py#L86

I changed that to use async_create_task() instead and the warning went away.

I still have some errors in the logs though...

`2024-05-17 23:45:04.570 WARNING (MainThread) [homeassistant.components.backup] fpl does not implement required functions for the backup platform

2024-05-18 00:17:55.129 ERROR (MainThread) [custom_components.fpl] `

I still don't think my energy dashboard is populating correctly though. Which sensor should I be using in the energy dashboard configuration?

image image image