Skip to content
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 verisure ethernet status #28656

Merged

Conversation

@thomasgermain
Copy link
Contributor

thomasgermain commented Nov 9, 2019

Breaking Change:

No breaking change

Description:

Add a binary_sensor to know the ethernet connection status.

Related issue (if applicable): fixes #

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#11135

Example entry for configuration.yaml (if applicable):

verisure:
  username: USERNAME
  password: PASSWORD

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@project-bot project-bot bot added this to Needs review in Dev Nov 9, 2019
@thomasgermain thomasgermain marked this pull request as ready for review Nov 9, 2019
@thomasgermain thomasgermain force-pushed the thomasgermain:verisure_ethernet_status branch from 399d338 to 934c942 Nov 9, 2019
thomasgermain added a commit to thomasgermain/home-assistant.io that referenced this pull request Nov 9, 2019
Update documentation accordingly to PR home-assistant/home-assistant#28656
thomasgermain added a commit to thomasgermain/home-assistant.io that referenced this pull request Nov 9, 2019
Update documentation accordingly to PR  home-assistant/home-assistant#28656
@thomasgermain thomasgermain mentioned this pull request Nov 9, 2019
1 of 2 tasks complete
@frenck

This comment has been minimized.

Copy link
Member

frenck commented Nov 11, 2019

The first impression, while reviewing the documentation, why add an option to enable/disable this sensor?

Is there a problem with having it always enabled?

@thomasgermain

This comment has been minimized.

Copy link
Contributor Author

thomasgermain commented Nov 11, 2019

Hi,

there is no problem with having it always enabled. It doesn't require any extra queries to verisure API.

I just wanted to keep the same behavior (like door_windows, smartplugs etc.)

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Nov 11, 2019

We don't allow config options anymore that control what entities to create. There are some exceptions to that rule, like the one mentioned regarding extra requests.

https://github.com/home-assistant/architecture/blob/master/adr/0003-monitor-condition-and-data-selectors.md

Dev automation moved this from Needs review to Review in progress Nov 11, 2019
@thomasgermain

This comment has been minimized.

Copy link
Contributor Author

thomasgermain commented Nov 11, 2019

Ah sorry my bad.

I removed the option, I guess I can drop the PR for the doc ?

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Nov 11, 2019

The branch now contains many unrelated commits. Please rebase and remove the stray commits or start over in a fresh branch and PR.

@thomasgermain thomasgermain force-pushed the thomasgermain:verisure_ethernet_status branch from 43eafc8 to bb29ea7 Nov 11, 2019
@thomasgermain

This comment has been minimized.

Copy link
Contributor Author

thomasgermain commented Nov 11, 2019

So, it should be ok now.

What is the problem with CheckFormat ?

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Nov 11, 2019

Please run black code formatter from the project root.

black --fast homeassistant tests
@thomasgermain thomasgermain force-pushed the thomasgermain:verisure_ethernet_status branch from af469ea to fcb03ff Nov 12, 2019
@thomasgermain thomasgermain force-pushed the thomasgermain:verisure_ethernet_status branch from fcb03ff to 5f631ed Nov 12, 2019
@thomasgermain thomasgermain requested a review from MartinHjelmare Nov 13, 2019
Copy link
Member

MartinHjelmare left a comment

Looks good!

@property
def is_on(self):
"""Return the state of the sensor."""
return hub.get_first("$.ethernetConnectedNow")

This comment has been minimized.

Copy link
@MartinHjelmare

MartinHjelmare Nov 13, 2019

Member

It would be good if the library would be rewritten to not require the user to know the protocol details, and instead expose different methods for different features of the hub. We try to avoid this level of protocol details inside home assistant.

But this is out of scope of this PR.

Dev automation moved this from Review in progress to Reviewer approved Nov 13, 2019
@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Nov 13, 2019

Please update the config example in the PR description to not include the option.

@thomasgermain

This comment has been minimized.

Copy link
Contributor Author

thomasgermain commented Nov 13, 2019

Please update the config example in the PR description to not include the option.

Done !

Thanks for your input :)

@MartinHjelmare MartinHjelmare merged commit ec45e72 into home-assistant:dev Nov 13, 2019
11 checks passed
11 checks passed
CI Build #20191112.49 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected when comparing 48fd95c...5f631ed
Details
codecov/project 94.43% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Nov 13, 2019
@lock lock bot locked and limited conversation to collaborators Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
4 participants
You can’t perform that action at this time.