#devs_core-archived
1 messages · Page 103 of 1
So using those specifics, I think he might want a global weather forecast, say one for Melbourne and one for Amsterdam
Say the HA instance is in Melbourne
So that one is fine, the issue is that he would like the Amsterdam one to be in its local time
But if you look there, the weather platform is just providing stuff in UTC
So the bug is with that weather platform, it should give a time with a UTC offset.
Then in your card or whatever in the frontend, you can have an option whether to display in HA time or in "sensor" time
right, that makes more sense to me now. but to be clear this is not about how the dates are stored, this is about the user being able to pick what timezone they want the weather to be displayed in (e.g. Weather for London, displayed in London time) so you can talk to someone in london and say, oh looks like its Sunny on Tuesday and you can be sure you're talking about THEIR Tuesday and not your Tuesday
Yeah
It gives a time with UTC offset? If you want to have a card displaying it in another timezone, you can just calculate that back from UTC
No since it's in UTC you've already lost some information
Like...that forecast data there
Is presumably for Vancouver
hmm you shouldn't be trying to built that kind of intention into the storage of the date though.
I guess there's no harm in having it though?
like you can't store a date with +2 and say "oh that's for XYZ region". obviously with daylight savings and the fact that regions share timezones, you can't say "oh that date is for london"
the ISO is not built to support that
I don't get it. what information is lost? You know the forecast @ UTC. The timestamps given in UTC (or UTC+offset) are calculated FROM the original timezone. calulating it from that to any other looses nothing.
Yeah, well that's what I meant by the 1:1 there. you can't back out a time zone.
But you can get a local time.
Yeah, it loses where the sensor is
Well that is easy
So if those timestamps were stored with a UTC offset
where the sensor is should not be built into the date, you need to store that separately
It would be fine
They are?
If not
it is a bug in the integration
Yup
Look at his issue. They're all +00:00
So it's just a bug in whatever weather platform he's using
integration
Hence: <#devs_core-archived message>
Yup
That's what I'm saying too. But just used the wrong word platform instead of integration 😅
Here
Alright, agreed on that. I just found an integration that doesn't do it correctly
2 already at this point
One is my own creation 🙈
It is not, making them perfect is the art 😄
Instituto Português do Mar e Atmosfera
ah that is IPMA
Yeah I wrapped my client.stop() in a function that takes an Event argument, like your example, not sure why it's needed but it works
OK hard to say w/ o looking at the code, but glad you have something working
Hey folks. First time contributing here but was playing with rest_command and wishing there was a way to get data back from it for use in an automation. I ended up with a generalized way to return values from service calls, but am curious to hear feedback on whether the approach is ok or if I'm totally barking up the wrong tree: https://github.com/home-assistant/core/pull/74729
Usually changes like this to core require some higher level discussion outside of a PR -- e.g. https://github.com/home-assistant/architecture/discussions/777
your use case for scripts is interesting, and not part of the existing discussion (e.g. templates approach wouldn't help i think)
The solution here felt relatively straightforward and was a fairly minimal change. It turned out to make it possible for user scripts to return values as well very simply
Might be worth engaging in that architecture discussion
Thank you for the pointer
One of the PRs linked there had a similar approach to use events to return values which was not accepted
so typically these architecture discussions (e.g. best practices or changes to core apis) are for larger decisions that have longer term implications about maintenance, how code is structured, or help keep user expectations in check about how things work. They require some approval from a couple core members before proceeding.
(I've implemented what i proposed there and its also not super complicated either, but the amount of implementation work isn't necessarily the most interesting part of the discussion)
Understood
Given there wasn't a lot of initial response "e.g. yes, good direction, let's talk through this more", i'm thinking that implicitly means folks aren't super thrilled about this specific proposal without thinking through more implications or something simpler. we can probably keep thinking about it and find something better
+1. I think the biggest difference between this and that PR linked in the discussion is that this aims to formalize the construct rather than have a bespoke mechanism for a specific integration. But 100% needs to be vetted and there may be a better way to get there.
Also, the approach in that PR doesn't make the data available as a variable (as e.g. loops and waits do) in templates within a script -- you have to rendezvous with it by waiting on the event.
So... Maybe there's something meaningfully different there worth discussing?
I have my custom integration device and entities setup. Now, I want to add a function to my device which will monitor a serial port and update my entities using local push. Is there an homeassistant call to do this and/or an existing integration I can use as a model? Thanks
Thanks again for the pointer. Moved discussion there.
Thank you, this is not my area of expertise for sure
Definitely not mine either 😉
@echo sand posted a code wall, it is moved here --> https://hastebin.com/osuworolaw
dont know if this is the correct place to ask this question. so please redirect me to where i should ask this.
i am using pyscript to create a few custom services. currently i am working on the services required to create my custom alarm clock which only requires setting a alarm on google home which will trigger a automation.
i am currently trying to get the alarms of the google home by adapting the scripts given here https://rithvikvibhu.github.io/GHLocalApi/ . i had it all working without home assistant.
i am currently making it callable as a service so i can use it better in home assistant but am stuck at the point where i am calling a blocking function that is part of a external library.
the problem i am having is that i need to use the result of the function and i cant figure out how to call it in a non blocking way and still get back the result from it. the function i am using to call it is above
Hi everyone. I maintain the Mazda integration, which communicates with a cloud service that has anti-bot protection in the form of TLS fingerprinting. When HA upgraded to Python 3.10, the default TLS ciphers changed, and my integration stopped working. I tried setting the ciphers back to what they were in Python 3.9, but it didn't help, so there must be something else that changed in the TLS handshake and is triggering the anti-bot mechanism. Does anyone have experience troubleshooting this type of issue?
hello, I'm working on making home assistant from buildroot, and I want ssh access, but I am finding usb import to be tedious. I tried adding authorized_keys to the rootfs overlay, but that did not seem to work. any suggestions?
Anti botting may be hard to circumvent because it can be based on a lot of factors out of your control including IP and timing. Tesla moved from aiohttp to httpx because the app was getting blocked. We had packet captures showing requests and aiohttp calls being identical and aiohttp said it wasn't something they could debug.
Thanks for the reply! I'm also using aiohttp in the Mazda integration. What did switching to httpx allow you to accomplish that you couldn't do with aiohttp?
It has a different signature so didn't trip the antibot proxies.
Gotcha. I'll have to give that a try.
My case is slightly different because nothing changed on Mazda's servers. The problem started when upgrading from Python 3.9 to 3.10
The change in python may have changed the timing of the auth if not the request headers. I pasted the issue above if you want to compare
Thanks for the link. Mazda is also using Akamai so that gives me some hope. (Not sure if it is Akamai Global Host or some other Akamai product)
Does anyone know how to prevent a browser from using cached images while navigating the HA UI? "Cache-Control": "no-cache" seems to be ignored.
Anyone after the update to 2022.7 (from 2022.6.7) got a continuos reboot of Home Assistant?
Hi everyone.
I´m trying to upgrade my home assistant core from 2021.3.4 to 2022.7.
But I´m getting this error message in Supervisor log.
22-07-10 12:12:23 ERROR (SyncWorker_2) [supervisor.docker.interface] Can't install ghcr.io/home-assistant/raspberrypi3-homeassistant:2022.7.2: 404 Client Error for http+docker://localhost/v1.40/images/ghcr.io/home-assistant/raspberrypi3-homeassistant:2022.7.2/json: Not Found ("no such image: ghcr.io/home-assistant/raspberrypi3-homeassistant:2022.7.2: No such image: ghcr.io/home-assistant/raspberrypi3-homeassistant:2022.7.2")
I´ve check the storage, there should be no problems with full storage.
Do you guys know what may be the issue here?
Check #installation-archived - this channel here is for development
how can i change an entity unit on the fly?
i tried:
self._unit = self.coordinator.units[self._pid]
self.async_registry_entry_updated()
and
entity_register.async_update_entity(entity_id, unit_of_measurement=temp_unit)
and neither worked
I don't think it's intended to. For a sensor you should only use native_unit_of_measurement anyway.
The issue i'm trying to solve by dynamkcally changing the units is the following:
The units are only know some amount of time after the entities are created, because the communication will only work the next time the user enters the car, and i create the entities with an assumed unit, that may be incorrect when i receive the correct ones.
Whats the best way to solve this if i cant change units on the fly?
and this is the entity code, thats why i was updating the self._unit()
@property
def native_unit_of_measurement(self):
"""Return the unit of measurement."""
return self._unit
return self.coordinator.units[self._pid] I would guess. Then likely empty at first and then sets the correct unit.
We're adopting a new entity naming strategy. Calling all integration maintainers to help update their integrations. More info @ https://developers.home-assistant.io/blog/2022/07/10/entity_naming
On entity naming: is it breaking to change the device name of the current device name isn't nice?
***"...if the current device..."
Hi, Is any docs for core testing guide or how to run unittest?
that worked, i had tried that, but i had a problem in the code that was setting the unit in the coordinator, so it wasnt changing, thanks for the help ! 😊
if an integration stops allowing yaml setup, and needs new configuration parameters, what should i call in async_setup to warn in the UI?
There is a cv.deprecated config validator - this would log a warning. Other than that breaking changes are published in the release notes.
Are you not able to import the yaml config to the new ConfigEntry? Maybe use an import step where you query the user for the missing information...
I can import the old info, but the new version uses an id instead of the email, so the user needs to fill that.
How can I flag that a step needs to be completed so that it shows in the UI that attention is needed?
You could raise ConfigEntryAuthFailed and thereby allow adding/adjusting it in a reauth flow. Not a perfect fit I guess but would solve your issue.
Yes, force a reauth to get the info. Don't overcomplicate it for yourself by doing custom config steps. You can warn people with a breaking change in the release notes.
I'll do that then, thanks for directing me
I guess you could convert your import step to be a "confirm step" like other discovery methods use - and call a next step from there if you don't want to go the reauth-way.
hi. i fixed an error in a dependency which is in pypi. where do i need to insert the new version number? Is it enough to update the manifest.json file of the integration, which uses the dependency?
Update the manifest and run script.gen_requirements_all
thx!
Anybody got an idea why I'm getting flagged for missing docs when there is a linked doc PR on: https://github.com/home-assistant/core/pull/74181
You also need to post a diff between the versions in the description of the PR - but yes mostly
Probably because you didn't check the checkbox 😉
ah
That tag requires humans to add/remove it. It’s not automated
this isn't contribution related but not sure where to get the right audience for this question: #general-archived message
Hey, I am looking for a little direction in writing an integration for a Ryobi Garage Door Opener that features a Websocket (python's websockets library) for continuous state updates. I'm hoping someone can point me to a similar functioning integration to help me learn. I am writing the library that will communicate with the Ryobi servers right now and am struggling with having a Websocket run in the background (forever) that listens for state update messages while allowing other things to happen (like receiving commands from HA or the user then relaying them to the websocket). Thanks!
Try searching for "cloud_push" integrations as examples. Many of those use websockets. Preferably async 😉
Great, thank you. Foud Plex has a websocket-based integration. Looking into it now!
Hi 🙂 I am implementing a new Homematicip device (HmIP-STE2-PCB). This device has two temperature sensors and a difference value. Should that be presented as 3 different sensors? And does that mean, i have to implement three different classes, which are inherited from Entity?
I think 3 sensors would be the way to go. If you need 3 Classes depends on the current implementation - ideally you'd need 3 instances of the same class.
Thx. I think one class for temp Sensors and one for the difference.
okay. There are 3 instances of a temperature sensor entity for the same device. But how to tell, which sensor is for which channel? or rather, which channel one, channel 2 and difference?
how to make it visible to the user
On TrueNAS 13.0 - does anyone know how I update to Cargo edition 2021?
Before I update I'm not able to update HA to 2022.7.*
Updating HA and help with that, please use the support channels
hi, anybody solved this pre-commit issue?
pylint...................................................................Failed
- hook id: pylint
- exit code: 32
Usage: pylint [options]
pylint: error: no such option: --ignore-missing-annotations
I see 2 questions here about that, without solution
I think you're using an old version of pylint iirc
you're right! I thought that it got updated by script/setup, but it stays old one
thanks!
hi, can this PR https://github.com/home-assistant/core/pull/75285 with bugfix be added to 2022.7.6 milestone? otgw was broken since x.7.0
I've added it to the milestone. It seems it doesn't have a quality score yet. Please don't check "Platinum" if it isn't verified.
I'm not the dev, @viscid bronze is tho
It has met the criteria for a while now (unless they were changed recently) and all related PRs over the last ~2years were marked the same. What else is needed to get the score listed?
If it meets the criteria you can do a PR adding the "quality_scale" key to the manifest. Here is an example https://github.com/home-assistant/core/pull/60531 (its hard to search these as the term "quality scale" is in each and every PR 🤪)
You should probably also remove the .coveragerc entries for your integration.
And maybe look into type annotating it 🧑💻 and see if you can add it to .strict-typing - but thats not needed - just a nice extra
I'm working on this PR to improve trigger schema validation and I've added some code to device_automation/trigger.py (https://github.com/home-assistant/core/pull/75044/files#diff-c860f93df1901ece1ff65e3a36b91cd20e074e2f6ecc015fc2c3182c723c4248).
I'm having a problem deciding what the right way to handle the error is. If the schema is invalid it throws a vol.Invalid exception. That's caught and wrapped in another vol.Invalid that includes some extra context (e.g. the fact that it's a trigger that failed validation). When the exception is caught and printed (by _format_config_error here: https://github.com/home-assistant/core/blob/dev/homeassistant/config.py#L467) the inner exception is hidden so you only see "invalid trigger configuration" and you don't get the actual schema validation error because vol.Invalid is treated as being "friendly" so it hides the exception stack.
So I've got two options:
- Don't set the isFriendly flag for
vol.Invalidwhich would impact a bunch of places, but would log the full exception trace. - Update
_format_config_errorto loop through theex.__cause__and include the messages of all the exceptions all the way down.- This is a little cleaner, but then I have to handle the case where the
__cause__is not the same type. E.g. if the outer isvol.Invalidand the inner is not, shouldisFriendlybe set to true? What about the other way around?
- This is a little cleaner, but then I have to handle the case where the
Happy to make changes and take suggestions here, I'm just not quite comfortable with the whole code base to know the full impact that a change here would have. 🙂
Can entities be added to devices of a different integration? Ie. a power sensor entity for some appliance that is already integrated in HA but doesn't provide that feature itself.
Hi there, for the dutch smart-lock Loqed we have created an integration which needs to be reviewed. @keen belfry already reviewed, but seems to busy to finish the review. Can someone else look at it? https://github.com/home-assistant/core/pull/70080
There are many PRs open for review
please don't ask around for reviews, there are PRs open that are older that need attention too
If you want things to get reviewed sooner, please join and help out reviewing the queue
Ok. Thanks for your response @keen belfry !
Has anyone noticed intermittent slowness in ThreadPoolExecutor jobs in 2022.7?
Nvm I think I found the issue, will create a PR
@keen belfry, do you have suggestions for new-ish contributors on how to pick which PRs are good to review. I’ve mostly been focusing on PRs with little to no conversation, but I’m assuming there are older PRs that need new eyes. Is there a tag that we can filter for?
Not really.
We have labels to categorize types (bugfix, new-integration, config-flow) and those kinda things
There is one exception: “smash”, which are quicker/smaller/HQ/almost finished/needs second pair of eyes PRs
frenck, how is the "smash" tag used? i have a PR (#73911) for the dynalite component, where all the review comments / requests have been implemented and it has been marked as "smash" 18 days ago with no activity (except me putting a comment once a week so it doesn't auto-close). not complaining, but just to set the expectations, how long does it usually take?
how long does it usually take?
There is no usual
So expect nothing (sounds harsh, but that is what it is)
in the end
someone has to go in and do something with it 🤷♂️
The "smashed" marked ones generally go faster, and is merely an indicator for people that have a couple of minutes left in their day and want to help out
hey everyone. I maintain the Risco integration, and recently added local communication to the downstream package (the integration currently communicates over their cloud platform).
I do think a lot of users would still opt for the cloud integration (doesn't require the installer code, works on more models, etc...) but I'm a little torn on whether this deserves a new integration or modification of the existing one.
On the one hand, there will be a lot of common code between the two versions, but on the other, there will be different entities, a completely different config flow, and there are some material differences between the two. Additionally, I'm not even sure what to write in the manifest if it's the same integration (one protocol is cloud poll and the other is local push).
What are your thoughts?
thanks
1 integration that supports both modes is the way to go, with different config flow
Mark it local since it can support local, even if it also supports cloud
question - is there interest in making the config / option flow more generic? today, if the configuration is complex, it can either be configured via yaml (which we want to get out of) or via multiple complex navigation menus. i was thinking of extending it to something similar to the automation GUI setup, but it would require some backend + frontend work. I can happily do both, but wanted to know if the overall concept is interesting
Not sure if I follow what you mean?
basically what i see as missing are two things: 1. the ability for variable sized lists and 2. the ability to have sub-objects. the reason i compared it to the automation is that the screen will be very similar to the automation setup: a few constant fields, and a few variable sized (e.g. in an automation, zero or more conditions, triggers and actions). for each object, you can add one more, duplicate, delete, etc. a very simple use case is to configure the logger, which in yaml is a variable sized list of topic / level. I believe that if this capability is added, it should be simple to move all (or almost all) configuration easily to the UI.
another thing (that also exists in automation) is context-aware fields. for example, when you select a trigger of type "state", you get different fields than trigger of type "device". The way I see it, there should be some infrastructure in the frontend, but this would be done for each component in its own config flow
I think if such things should be considered for the automation UI, it should be based on a UX design I guess
apologies. i didn't explain it correctly. I wanted to "copy" the UX design that already has for automation and generalize it so it can be fired from a data entry flow
I'm not sure if I follow
you mean the Selectors support?
(as in, the "UX" for automations is not something we want to keep for the future, as in, that needs lots of work so lets not copy that 😉 )
for the last bullet, yes
this is good to know... however, if you generalize it, you could group many configuration screens under it and IMO reduce code complexity.
I'm still not following, sorry 🤷♂️
I don't see the link between automations and config flows
Please note that most elements used in automations and blueprints (selectors) are available in config flows (since 2 releases or so)
But feel free to set up an architecture discussion to get this sorted though 🙂
today, a config flow can pass async_show_form and create a screen on the UI with a constant set of fields. i am talking about extending the config_flow to enable more complex structures (lists, sub-objects, and fields depending on another field). the reason i used the automations as an example is that the GUI already knows how to do these things for an automation config (via custom panels in the frontend). once this flow exists, the automations (and other flows probably) could be standardized to the same flow. All it needs is the async_show_form to be able to describe this more complex form and for the UI side to know how to interpret it
how do you set up an architecture discussion? i am still new to this..
(lists, sub-objects, and fields depending on another field)
It already supports list, even with predefined values, key/value pairs, including allowing custom values.
Dependencies have been added recently
once this flow exists, the automations (and other flows probably) could be standardized to the same flow.
Automations aren't flows.
Think this is a great idea. I also stumbled across a few problems when implementing a config flow, where I needed the user to insert a list of sub objects, but there was no way to do this in the config forms yet, so I decided to use the ObjectSelector with some instructions how to user it, but it's far from user friendly. Would be great to have this extended with more extensive support.
Any examples on this? Which integration can we look at?
Sure, all selectors can be used
they are used by many helper integrations
But is fairly new, so not that many examples available yet (in the existing code base that is)
I did read this docs before, but could not work out how to provide user friendly configuration for example for this case:
states_power:
playing: 8.3
paused: 2.25
Ideally I want the user to have a plus sign to add a new row. The new row would be an object with 2 selectors, a attribute selector and a float field.
This is similar to how the user can add new condition / action rows in the automations. But I don't see any possibilities for it in the config data flows.
Yup combined fields as sets isn't possible (yet)
There isn't direct need for it at this point in the core
however, there is an core idea in the works that may require it
I'd also love some extension of the current flow system. Or even better: a canonical way to create custom panels. Right now there is a huge gap between the ease of creating a flow vs. creating a panel. This would help some yaml-only stuff to get to UI config in a user-friendly way - and more beyond that.
Or even better: a canonical way to create custom panels.
Panel can be created as you please nowadays. As those are fully custom panels, you can do what you want I guess 🤷♂️
but do you know if they allow custom panels in the UI? i thought they were frowned upon. tried to start writing one and they didn't want it. it was some time ago, so perhaps the feelings changed
that's exactly what i meant: extending the easy config-flow route to more complex screens so custom panels are not needed.
See insteon 🤷♂️
is config_entry_flow.register_discovery_flow a new function? It only seems to be in a couple integrations. And if so does this allow me to do UDP based discovery on the fly instead of when the integration is triggered?
Sometimes I'm getting a 3 seconds delay for a binary_sensor to trigger an automation. I've monitored the system performances, and it doesn't seem to be overloaded. Do you have suggestions on how I can verify this problem? More info here : https://community.home-assistant.io/t/trigger-is-very-slow-whats-happening/441458
My first assumption would be blocking calls in the main thread.
Is there any way to investigate this scenario?
Looking at the log I've this : ```
2022-07-19 15:46:15 INFO (MainThread) [homeassistant.components.automation.tesla_change_amps] Tesla Change Amps: If at step 1: Executing step call service
2022-07-19 15:46:19 WARNING (MainThread) [custom_components.solaredge_modbus] Failed to read inverter 1 data
2022-07-19 15:46:19 INFO (MainThread) [homeassistant.components.automation.cmd_porta_abitazione_one_shot] Cmd Porta Abitazione One Shot: Running automation actions
Button for the binary sensor has been pressed at 15:46:16. Trigger started at 15:46:19. Either the ``automation.tesla_change_amps`` or the ``custom_components.solaredge_modbus`` can be the problem?
Yes
solaredge_modbus looks like a bad actor
Assuming this is getting called from the event loop
The read_modbus_data call goes down and uses the sync client of pymodbus...
Yup that doesn't look right indeed
just looked in insteon, both on core and looked for it in frontend. where is the custom panel implemented?
not in de frontend, it is bundled in the integration
This solaredge modbus implementation has started to return a lot of Failed to read inverter x data or Connection to x failed: Timeout probably since the upgrade to 2022.7. I was trying to investigate this problem. Do you have suggestions on how to improve the read from the modbus? Another component for solaredge modbus is https://github.com/erikarenhill/solaredge-modbus-hass which has a different approach to the async. https://github.com/erikarenhill/solaredge-modbus-hass/blob/c9d1c934c0e03cf6634de5386f38320e922b131c/custom_components/solaredge_modbus/sensor.py#L68
some are in the frontend as well... https://github.com/home-assistant/frontend/tree/dev/src/panels/config/integrations/integration-panels but I guess these are some kind of special.
Here is insteons panel registration https://github.com/home-assistant/core/blob/dev/homeassistant/components/insteon/api/__init__.py the source itself is loaded as a requirement in manifest.json from pypi (https://github.com/pyinsteon/insteon-panel)
It looks like that package does the same thing. It should be an easy fix, you can just change line 187 there to use an executor job like "update_result = await self._hass.async_add_executor_job(self._read_modbus_data)"
But the better way to do it is to use the asyncio methods which the pymodbus library seems to have
Take it with a grain of salt though, I don't know what solaredge is and I don't know what modbus is
I'm migrating a custom integration to core. The call async_step_import is for a YAML config right? I'm assuming i can nix that call?
ok. i see it now. it was in the API section. This is super cool and would allow me to remove yaml configuration from the dynalite component. thanks for your patience. Also, is there any documentation of this API and what is required from the frontend panel (in typescript)?
I cannot help you answering frontend questions, sorry.
you helped enough. i will ask in the other forum. i now have a good lead to a solution. Thanks!
Yes. I believe yaml importing is still integration discretion now
I will try first to disable the component, so I can check if the slow trigger is happening anyways. And I will work on the async suggestion. Thanks!
I'm working on refactoring the volvooncall component to leverage config flow instead of YAML config. However, the existing config schema doesn't seem to work when I feed it to async_show_form(). Is there any documentation that outlines the schema limitations inherent to async_show_form()?
Namely, async_show_form() doesn't seem to handle "complex" schemas such as:
vol.Optional( CONF_SCAN_INTERVAL, default=DEFAULT_UPDATE_INTERVAL ): vol.All(cv.time_period, vol.Clamp(min=MIN_UPDATE_INTERVAL)), vol.Optional(CONF_NAME, default={}): cv.schema_with_slug_keys( cv.string ), vol.Optional(CONF_RESOURCES): vol.All( cv.ensure_list, [vol.In(RESOURCES)] ),
We don't allow scan interval option. The user can disable automatic polling of any integration that supports config entries and automate polling via the homeassistant.update_entity service. Name should preferably not be needed, if the connection can be identified with something already, like VIN number. We don't allow specifying what resources to set up unless it impacts performance significantly eg, request load on a cloud service. The user can disable any entity, with a unique id, that they don't need.
Excellent feedback, thanks @robust flame . In summary -- get rid of these config options entirely.
I'd recommend to first refactor the integration to use our DataUpdateCoordinator helper. And then do the config flow / config entries after that.
https://developers.home-assistant.io/docs/integration_fetching_data#coordinated-single-api-poll-for-data-for-all-entities