-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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 check that sensors don't have EntityCategory.CONFIG set #101471
Conversation
Hey there @mib1185, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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 entity_category
is a settable attribute for MQTT entities. That includes MQTT sensors.
So If we want to correct this we should deprecate the setting for use on sensor and binary sensors.
I am not sure about this change.
That is not going away. It only raises in case an CONFIG entity category is used for an sensor entity. The reason is because, the configuration category is for read/write entities that control things. A sensor can never control things (and thus the change triggering because of this change are incorrect to begin with). The function of the entity categories has been documented correctly from the start. ../Frenck |
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'm fine with the changes in nextcloud
👍
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.
Thanks, @edenhaus 👍
../Frenck
This is a breaking change in my opinion. It really should have been a warning with a depreciation period. Next integration with issue being z2m: #103414 Ps. Its not explicitly stated its illegal to set on sensor entities. It make sense for readonly settings (controlled on device only). Im not against the change, just that its a change that break existing setups. We could just have ignored the value. |
It is not, this has been correctly documented as well. Diagnostic entities are read only, while config can write, as per dev docs. Sensor entities are thus never configured as they are read only. Z2M has been adjusted upstream accordingly and the maintainers informed prior stable release. |
Breaking change
Proposed change
Sensors cannot have EntityCategory.CONFIG as they cannot change anything.
Add a check for it and fix
nextcloud
,mqtt
andesphome
Type of change
Additional information
Checklist
black --fast 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
..coveragerc
.To help with the load of incoming pull requests: