cibernox / homeassistant-poolstation

HomeAssistant custom component for integrating the Poolstation platform.
MIT License
9 stars 4 forks source link

deprecated NumberEntity features #5

Closed TonCoronel closed 1 year ago

TonCoronel commented 2 years ago

Hi, first of all Thanks for this plugin LOVE IT! One issue I have remaining is that once or twice a day it requests me to re-enter my credentials...

But the one I am reporting now is the following:

Getting this message in my logs regarding poolstation

Entity None (<class 'custom_components.poolstation.number.PoolTargetPh'>) is using deprecated NumberEntity features which will be unsupported from Home Assistant Core 2022.10, please report it to the custom integration author. Entity None (<class 'custom_components.poolstation.number.PoolTargetElectrolysisProduction'>) is using deprecated NumberEntity features which will be unsupported from Home Assistant Core 2022.10, please report it to the custom integration author. Entity None (<class 'custom_components.poolstation.number.PoolTargetORP'>) is using deprecated NumberEntity features which will be unsupported from Home Assistant Core 2022.10, please report it to the custom integration author.

cibernox commented 2 years ago

yeah, the logging thing is really annoying for me too. I'm not sure why it would be happen, my guess is that poolstation is detecting that we're making too many requests (roughly every 30 seconds) and it logs the integration out. I have some code to rescue from this error and attempt to log in again with the saved username and password, but it doesn't seem to be working and I didn't have time yet to investigate why.

TonCoronel commented 2 years ago

Hi @cibernox,

Thanks for the update, I guess polling every 30 seconds is also a bit to much, once every 5 minutes should give plenty of information right?

But the real issue I logged was regarding the use of the deprecated "NumberEntity" which will be removed next month...

cibernox commented 2 years ago

@TonCoronel Until school starts again I'm barely holding on here. Two more days 🤞 , then I should be able to have some time to check it.

That said, 30 seconds shouldn't be too much. It might not matter knowing the PH of the pool that often, but it is somewhat important to know if the chlorinator is working to, perhaps, count time to know when to turn it off. In fact the web client polls the API even faster than that

RienduPre commented 1 year ago

It looks like I have the same problem. See below.

Is this integration still maintained.

@cibernox Your help is much appreciated.

2023-05-03 13:47:35.580 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for poolstation using this method at custom_components/poolstation/init.py, line 71: hass.config_entries.async_setup_platforms(entry, PLATFORMS) 2023-05-03 13:47:35.863 WARNING (MainThread) [homeassistant.components.number] custom_components.poolstation.number::PoolTargetPh is overriding deprecated methods on an instance of NumberEntity, this is not valid and will be unsupported from Home Assistant 2022.10. Please report it to the custom integration author. 2023-05-03 13:47:35.870 WARNING (MainThread) [homeassistant.components.number] custom_components.poolstation.number::PoolTargetORP is overriding deprecated methods on an instance of NumberEntity, this is not valid and will be unsupported from Home Assistant 2022.10. Please report it to the custom integration author. 2023-05-03 13:47:35.872 WARNING (MainThread) [homeassistant.components.number] custom_components.poolstation.number::PoolTargetFreeChroline is overriding deprecated methods on an instance of NumberEntity, this is not valid and will be unsupported from Home Assistant 2022.10. Please report it to the custom integration author. 2023-05-03 13:47:35.874 WARNING (MainThread) [homeassistant.components.number] custom_components.poolstation.number::PoolTargetElectrolysisProduction is overriding deprecated methods on an instance of NumberEntity, this is not valid and will be unsupported from Home Assistant 2022.10. Please report it to the custom integration author.

cibernox commented 1 year ago

I need to find some time to revisit this, but yes, It is still maintained and It will be maintained for as long as I still have the same chlorinator 😄.

Now that the new bath season has started (in fact I cleaned the pool today) I should find some time to bring it up to date. And hopefully also add some kind of automatic re-authentication.

RienduPre commented 1 year ago

I updated to 2023.5 today and the intergration is now broken completely😫

cibernox commented 1 year ago

well, I think I should take a look asap then.

cibernox commented 1 year ago

Well, i tool a while just to setup all the environment to make changes again, but I've updated the most pressing problem that prevented the integration from working in 2023.5. You can update already. I'll take care of the deprecated number entities next, but while deprecated those continue to work.

RienduPre commented 1 year ago

Super!!, Tried it and it works. i'll be installing my system the upcoming week, so I'll let you know hoe this goes

straybiker commented 1 year ago

The documentation of the change can be found here if you did not have it already: https://developers.home-assistant.io/blog/2022/06/14/number_entity_refactoring/

straybiker commented 1 year ago

This one can be closed I guess. I don't see the warning anymore

cibernox commented 1 year ago

yes it can!