Add new number entity integration#42735
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with an integration ( |
|
Would not be better to modify |
|
No. I already tried that in the past. Please see home-assistant/architecture#328 |
Ok :( Btw I don't know better name but I'm not sure if |
frenck
left a comment
There was a problem hiding this comment.
This PR adds a new entity component.
New entity components need to be discussed using an architecture issue first. Please open an architecture issue.
|
Will update the PR today according to the architecture issues comments. |
|
Who has the power to fix the "integration: analog_switch" label of this PR? |
|
Could someone re-trigger the pipeline please? I want to see it all green) |
You can close and re-open the pull request. |
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
|
How do I fix this mypy error? If I satisfy its requirements to define the return type for |
Probably like this: |
Already tried this: f1f6617 |
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
|
It works! Thanks @frenck! |
frenck
left a comment
There was a problem hiding this comment.
👍 Looks good.
I would like to see a second opinion before merging though.
Breaking change
N/A
Proposed change
Add new integration for an analog switch, a new entity type that other platforms may use to get a value from user.
We already have a number of integrations that allow the user to set a certain value within a range, such as
light,climate,humidifier,input_number, andmedia_player. However we lack the generic integration that other integrations or platforms could use for a value input, along withsensorfor value output,binary_sensorfor boolean output, andswitchfor boolean input.This PR adds this support. It would allow to create a separate entity to control a volume for something that is not a media player (i.e. an alarm clock), or to control volume of more than 1 channel for a media player that needs it (multichannel or equalizer may be?), or to control the brightness of indicator LEDs of an air purifier device, or to set PWM level for a ZHA XBee device, all without complicated setup that involved manual input_numbers, automations, and services, or using entities that not exactly fit the actual device.
Other examples of the possible usage include:
rpi_gpioand arduino PWM outputType of change
Example entry for
configuration.yaml:# Example configuration.yamlAdditional 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.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: