-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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 ability to translate ENUM sensor states in Unifi integration #131921
Conversation
Hey there @Kane610, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
"disconnected": "Disconnected", | ||
"connected": "Connected", |
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.
Couldn't some states have references to already existing translations?
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.
"disconnected": "Disconnected", | |
"connected": "Connected", | |
"disconnected": "[%key:common::state::disconnected%]", | |
"connected": "[%key:common::state::connected%]", |
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.
Good point, forgot about that.
"inform_error": "Inform Error", | ||
"adoption_failed": "Adoption Failed", | ||
"isolated": "Isolated", | ||
"unknown": "Unknown" |
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.
unknown should not be its own state. Rather, the entity should return None
in that case (which for the end user would still resolve to unknown
, but the difference is, is that unknown
already is a valid state and shown in the automation editor)
"firmware_mismatch": "Firmware Mismatch", | ||
"upgrading": "Upgrading", | ||
"provisioning": "Provisioning", | ||
"heartbeat_missed": "Heartbeat Missed", | ||
"adopting": "Adopting", | ||
"deleting": "Deleting", | ||
"inform_error": "Inform Error", | ||
"adoption_failed": "Adoption Failed", |
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.
Use sentence case
"disconnected": "Disconnected", | ||
"connected": "Connected", |
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.
"disconnected": "Disconnected", | |
"connected": "Connected", | |
"disconnected": "[%key:common::state::disconnected%]", | |
"connected": "[%key:common::state::connected%]", |
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Breaking change
The states of
Device State
sensors have been standardized to match Home Assistant core rules and be translatable.This affects the following Unifi sensor states:
Connected
, which now becameconnected
Pending
, which now becamepending
Firmware Mismatch
, which now becamefirmware_mismatch
Upgrading
, which now becameupgrading
Provisioning
, which now becameprovisioning
Heartbeat Missed
, which now becameheartbeat_missed
Adopting
, which now becameadopting
Deleting
, which now becamedeleting
Inform Error
, which now becameinform_error
Adoption Failed
, which now becameadoption_failed
Isolated
, which now becameisolated
Unknown
, which now becameunknown
If you used those states directly in your automations, scripts, or templates; you will need to adjust those to match these changes.
Proposed change
Adds ability to translate ENUM sensor states in Unifi integration.
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: