Add update_pin_code service for Nintendo parental controls#169865
Open
pantherale0 wants to merge 5 commits intohome-assistant:devfrom
Open
Add update_pin_code service for Nintendo parental controls#169865pantherale0 wants to merge 5 commits intohome-assistant:devfrom
pantherale0 wants to merge 5 commits intohome-assistant:devfrom
Conversation
Introduced a new service to update the PIN code for Nintendo devices. The service requires a device ID and a new PIN, with validation for the PIN range. Updated the corresponding YAML and strings files to include this new service and its description. Enhanced tests to cover the new functionality and ensure proper error handling for invalid devices.
8 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new update_pin_code service to the nintendo_parental_controls integration so users can change a Nintendo device’s PIN from Home Assistant, along with UI metadata (services.yaml/strings/icons) and test coverage for success and common error cases.
Changes:
- Register a new
update_pin_codeservice (device + PIN) and wire it to the Nintendo API call. - Expose the service in the UI via
services.yaml,strings.json, andicons.json. - Extend service tests to cover the new service and consolidate invalid-device cases via parametrization.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/components/nintendo_parental_controls/test_services.py | Adds coverage for update_pin_code and consolidates service error tests with parametrization. |
| homeassistant/components/nintendo_parental_controls/strings.json | Adds localized strings/field descriptions for the new service. |
| homeassistant/components/nintendo_parental_controls/services.yaml | Declares the new service fields/selectors for the UI service picker. |
| homeassistant/components/nintendo_parental_controls/services.py | Implements and registers async_update_pin_code service handler. |
| homeassistant/components/nintendo_parental_controls/icons.json | Adds an icon mapping for the new service. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…Nintendo parental controls
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+119
to
+122
| "device_id": { | ||
| "description": "The ID of the device to update the PIN code for.", | ||
| "example": "1234567890abcdef", | ||
| "name": "Device" |
Contributor
Author
There was a problem hiding this comment.
Device IDs are generated and therefore the examples will always be incorrect regardless the length
joostlek
reviewed
May 6, 2026
Updated the update_pin_code service to accept PIN codes as strings and added validation for PIN length (4 to 8 characters). Adjusted the corresponding YAML configuration to reflect the change in PIN input type. Added error handling for invalid PIN lengths and updated tests to cover these scenarios.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Introduced a new service to update the PIN code for Nintendo devices. The service requires a device ID and a new PIN, with validation for the PIN range. Updated the corresponding YAML and strings files to include this new service and its description. Enhanced tests to cover the new functionality and ensure proper error handling for invalid devices.
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: