Repository navigation
Remove "Nabu Casa" from device name - #539
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #539 +/- ##
=======================================
Coverage 96.91% 96.91%
=======================================
Files 63 63
Lines 10498 10500 +2
=======================================
+ Hits 10174 10176 +2
Misses 324 324 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
I think this is fine. We could also explore introducing a new firmware command for "display name" or something and have this info be provided verbatim by the device. |
puddly
pushed a commit
to puddly/zha
that referenced
this pull request
Oct 24, 2025
* Remove "Nabu Casa" from device name * Add `test_name_nabu_casa_devices` test * Combine coordinator naming tests using `parametrize`
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
For any devices with the "Nabu Casa" manufacturer string, this PR removes that value from the full device name that's used to create device entries in Home Assistant.
Do note that both the independent manufacturer and model values stay untouched. This only affects the "combined name".
This PR also combines the following tests:
test_coordinator_info_uses_node_infotest_coordinator_info_generic_nametest_name_nabu_casa_devices(temporarily added in7cffa90(#539))Other options for tests
We can also revert the latest commit that combines these tests (
a505b8b(#539)) and do this in another PR if we prefer that.By expanding the tests cases, I've also noticed that we currently include a leading space for the full name if the manufacturer name is not provided. We should fix this in a follow-up PR, but for now, the unchanged behavior is at least seen in tests.
This likely hasn't caused us any actual issues so far, since HA might strip leading and trailing spaces from device names.
Additional information
This is done to avoid the ZHA coordinator device entry being called "Nabu Casa Home Assistant Connect ZBT-2" by default.
Since all devices with the "Nabu Casa" manufacturer include a "brand name" (HA Connect) in the model name, we can remove that from the "name" completely.
I also don't necessarily think we should hard-code all the "Home Assistant Connect ZBT-X" model names for the check, since what I mentioned above should apply to all Nabu Casa devices AFAIK. We can do this if required, of course.
If we can (/want to) move this into quirks in the future (see thought below), we'll do it there.
If we want to tighten the check, but keep it in a generic way for onw, we could also check that model includes just "Home Assistant" or "Home Assistant Connect" before removing "Nabu Casa" from the "combined name".
Backlog issue
Fixes: zigpy/backlog#44
Other implementation possibilities
I previously played around with implementing that in Home Assistant's ZHA integration, but had nothing that I liked really much. Since ZHA is the base for the "{manf} {model}" string, and we already have special cases for active coordinators in ZHA, it makes the most sense to implement this here IMO.
Another thought was that we may be able to move this out of ZHA into quirks at some point. Right now,
friendly_nameonly supports overriding the manufacturer and model individually, and we shouldn't set the manufacturer to an empty string, as that will break the "by Nabu Casa" text in HA.But we could consider expanding this in quirks v2 in the future, since we may be able to use this for other devices, where having both the manufacturer and model name combined is redundant, for example.
See below for a sample implementation in HA's ZHA integration within the
device_infomethod:Possible `device_info` implementation (click to open)