-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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 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 |
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.
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? |
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! |
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.
👍 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 withsensor
for value output,binary_sensor
for boolean output, andswitch
for 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_gpio
and arduino PWM outputType of change
Example entry for
configuration.yaml
:# Example configuration.yaml
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
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: