-
-
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
Refactor switch for vesync #134409
Open
cdnninja
wants to merge
19
commits into
home-assistant:dev
Choose a base branch
from
cdnninja:sensorRefactor
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+118
−49
Open
Refactor switch for vesync #134409
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0d67c7b
Refactor switch sensor so we can use it for more.
cdnninja 033cac8
Merge branch 'dev' into sensorRefactor
cdnninja 3a663de
Adjust order so all platforms match between PRs
cdnninja 6604d26
Correct type
cdnninja f4352fd
Attempt to fix mypy error
cdnninja f143594
Correct mypy erros.
cdnninja 1337372
Correct Errors
cdnninja 7b0510d
Add callbacks
cdnninja 8db10fb
Merge branch 'dev' into sensorRefactor
cdnninja 0ce2086
Add coordinator as per other PR
cdnninja 0fc9e81
Merge branch 'dev' into sensorRefactor
cdnninja 4a2fa3f
Merge issue
cdnninja 0288768
ruff
cdnninja c12b55d
Fedback
cdnninja 9043ba7
Merge branch 'dev' into sensorRefactor
cdnninja ff5f13c
Ruff correction
cdnninja 8f13594
Add exists FN
cdnninja 5b08b11
Corrections to pass tests
cdnninja e32f14f
Remove dimmable switch from scope to pass tests.
cdnninja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
Should we just use the power device class? We should either set the name to
None
(causing the entity to follow the device name, soswitch.vesync_device
) or if there already is another main feature of the device (say a climate entity or humidifier), we should use the device class translation for the POWER device classThere 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.
Any harm in us not filtering if say it is a fan or humidifer? name would be switch.vesync_device and allow a toggle for power. This keeps the code simple as I don't need to filter if one of those.
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.
Duplicate entity? Humidifier and fan both derive from ToggleEntity and expose the same actions.
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 will test this in conjunction with humidifier PR once that one is merged. Lets plan to merge this after that one.
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.
Sorry but why do we need this entity?
The
device_status
in pyvesync seems to reflect the on/off state which fan/humidifier entities will report as well viais_on
. They also have turn_on/turn_off to change the status. I did not check but I think the same should be true for light entities.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.
They used to sell outlets and switches. As per: https://www.home-assistant.io/integrations/vesync/ so this would show on off for the light switch or outlet. I am thinking I should add a filter ability so it can be removed for select situations. In the future this switch platform can offer other items though, which is the driver for the refactor.
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.
Switch and outlet would need that but I don't think they should be needed for fan/humidifiers.
My humidifier appears as following with off state.
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 will add an additional check so we can adjust for that. I won't get to this right a way since I think humidifier merge and binary_sensor take priority.