-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Import Influxdb integration level configuration into ConfigEntry #134463
base: dev
Are you sure you want to change the base?
Conversation
Hey there @mdegat01, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
2c5fd6b
to
057e22a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @RobBie1221, I've seen your name around! If you feel like it, feel free to drop me a message on Discord :)
setup(hass, config) | ||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: | ||
"""Set up InfluxDB from a config entry.""" | ||
config = dict(entry.data.items()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the library support extra fields in the dict? Otherwise I would be a bit more comfortable just creating a dict. (just for the case that in the future the entry.data might contain more keys and someone runs this version)
unique_id = f"{host}_{bucket}" | ||
title = f"{bucket} ({host})" | ||
|
||
await self.async_set_unique_id(unique_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the host is not a good unique id, can we get something specific from the database that is unique?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should skip setting unique id (was not aware that was an option). We should prevent creation of duplicate entries alternatively.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Import integration level configuration for influxdb integration into ConfigEntry. Implement load/unload entry functions. Platform level setup will be dealt with in a different PR, as well as full config/option flow.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: