-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
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
Add LetPot integration #134925
Add LetPot integration #134925
Conversation
"""Initialize LetPot time entity.""" | ||
super().__init__(coordinator) | ||
self.entity_description = description | ||
self._attr_unique_id = f"{coordinator.config_entry.unique_id}_{coordinator.device.serial_number}_{description.key}" |
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.
why the entry unique id as well? Can multiple accounts share a device?
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.
Actually yes as of yesterday :)
I coded this before yesterday though and believe it is required to make sure you don't get conflicts in case you have >1 device? If your account is abcd
and you have two devices which both will have a sensor with description light_schedule_start
, wouldn't you end up with the unique id abcd_light_schedule_start
twice?
Edit: misread that, yes entry unique ID wouldn't have been required if one device is only for one account, but now that there is device sharing between accounts it is.
Not sure what the failing job |
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Breaking change
Proposed change
Add a new integration for LetPot hydroponic gardens/systems. You can control the light (and in the future more, and view state info like whether the pump is running or if there are any issues).
As the initial platform you might expect light, but the device actually doesn't let you toggle the light directly but only via the light schedule (when should the light turn on or turn off). As a result I've chosen time as the platform for this PR.
Bronze
config-flow
- Integration needs to be able to be set up via the UI - see config_flow.py and manifest.json L5data_description
to give context to fields - see strings.json L9-L12ConfigEntry.data
andConfigEntry.options
correctly - all stored data is used for authentication so in ConfigEntry.datatest-before-configure
- Test a connection in the config flow - see config_flow.py L74unique-config-entry
- Don't allow the same device or service to be able to be set up twice - see config_flow.py L85-L86config-flow-test-coverage
- Full test coverage for the config flow - see:runtime-data
- Use ConfigEntry.runtime_data to store runtime data - see __init__.py L86test-before-setup
- Check during integration initialization if we are able to set it up correctly - see __init__.py L60, L65, L67appropriate-polling
- If it's a polling integration, set an appropriate polling interval - exempt: this integration only receives push-based updatesentity-unique-id
- Entities have a unique ID - see time.py L82has-entity-name
- Entities use has_entity_name = True - see entity.py L13entity-event-setup
- Entities event setup - see entity.py L10: using CoordinatorEntity as base with push updates, no other eventsdependency-transparency
- Dependency transparency - see library https://github.com/jpelgrom/python-letpot: MIT licensed, published to PyPI using CI action triggered by GitHub releasesaction-setup
- Service actions are registered in async_setup - exempt: this integration does not provide additional actionscommon-modules
- Place common patterns in common modules - see file namesdocs-high-level-description
- The documentation includes a high-level description of the integration brand, product, or service - see docs PRdocs-installation-instructions
- The documentation provides step-by-step installation instructions for the integration, including, if needed, prerequisites - see docs PRdocs-removal-instructions
- The documentation provides removal instructions - see docs PRdocs-actions
- The documentation describes the provided service actions that can be used - exempt: this integration does not provide additional actionsbrands
- Has branding assets available for the integration - see brands PRSilver
config-entry-unloading
- Support config entry unloading - push connection connects in coordinator.py _async_setup, disconnects in __init__.py async_unload_entrylog-when-unavailable
- If internet/device/service is unavailable, log once when unavailable and once when back connectedentity-unavailable
- Mark entity unavailable if appropriateaction-exceptions
- Service actions raise exceptions when encountering failuresreauthentication-flow
- Reauthentication flowparallel-updates
- Set Parallel updates - see time.py L22test-coverage
- Above 95% test coverage for all integration modulesintegration-owner
- Has an integration owner - see updated CODEOWNERS and manifest.json L4docs-installation-parameters
- The documentation describes all integration installation parameters - see docs PRdocs-configuration-parameters
- The documentation describes all integration configuration options - exempt: the integration does not have configuration optionsGold
entity-translations
- Entities have translated names - see time.py L36, L45entity-device-class
- Entities use device classes where possibledevices
- The integration creates devices - see entity.py L18-L25entity-category
- Entities are assigned an appropriate EntityCategoryentity-disabled-by-default
- Integration disables less popular (or noisy) entitiesdiscovery
- Can be discoveredstale-devices
- Clean up stale devicesdiagnostics
- Implements diagnosticsexception-translations
- Exception messages are translatableicon-translations
- Icon translationsreconfiguration-flow
- Integrations should have a reconfigure flowdynamic-devices
- Devices added after integration setupdiscovery-update-info
- Integration uses discovery info to update network informationrepair-issues
- Repair issues and repair flows are used when user intervention is neededdocs-use-cases
- The documentation describes use cases to illustrate how this integration can be useddocs-supported-devices
- The documentation describes known supported / unsupported devices - see docs PRdocs-supported-functions
- The documentation describes the supported functionality, including entities, and platformsdocs-data-update
- The documentation describes how data is updated - see docs PRdocs-known-limitations
- The documentation describes known limitations of the integration (not to be confused with bugs)docs-troubleshooting
- The documentation provides troubleshooting informationdocs-examples
- The documentation provides automation examples the user can use.Platinum
async-dependency
- Dependency is async - see async/await everywhere and libraryinject-websession
- The integration dependency supports passing in a websession - see __init.py__.py L42-L43, config_flow.py L55-L56 which is used by the library client's __init__strict-typing
- Strict typing - see .strict-typing L294Type 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: