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 device_class safety to synology_dsm storage binary_sensors #39310

Merged
merged 6 commits into from Aug 30, 2020
Merged

Add device_class safety to synology_dsm storage binary_sensors #39310

merged 6 commits into from Aug 30, 2020

Conversation

Mariusthvdb
Copy link
Contributor

@Mariusthvdb Mariusthvdb commented Aug 27, 2020

Breaking change

Proposed change

Changes the state and icon to reflect the safety state this binary_sensor attempts to reflect.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

Hey there @ProtoThis, @Quentame, mind taking a look at this pull request as its been labeled with an integration (synology_dsm) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

Dev automation moved this from Needs review to Review in progress Aug 27, 2020
@MartinHjelmare MartinHjelmare changed the title add device_class: safety to storage binary_sensors Add synology_dsm device_class safety to storage binary_sensors Aug 27, 2020
@MartinHjelmare MartinHjelmare changed the title Add synology_dsm device_class safety to storage binary_sensors Add device_class safety to synology_dsm storage binary_sensors Aug 27, 2020
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Aug 27, 2020

thanks @MartinHjelmare

I had copied this from the Stookalert integration
Should I change it there too?
Must exist other spots too in the core HA binary_sensors. Isn't a check-all test available for this?

@MartinHjelmare
Copy link
Member

Please do that in a separate PR.

from homeassistant.components.binary_sensor
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Dev automation moved this from Review in progress to Reviewer approved Aug 27, 2020
@Mariusthvdb
Copy link
Contributor Author

ok, changed and imported device_class Safety, compare :

from homeassistant.components.binary_sensor import (

@Mariusthvdb
Copy link
Contributor Author

please advise what to do. Isort changes to

from homeassistant.components.binary_sensor import (DEVICE_CLASS_SAFETY,
                                                    BinarySensorEntity)

but also

from .const import (DOMAIN, SECURITY_BINARY_SENSORS,
                    STORAGE_DISK_BINARY_SENSORS, SYNO_API)

which was untouched by me...

which hardly seems correct? Don't want to keep creating new error messages here.

@MartinHjelmare
Copy link
Member

Make sure to run isort in the project directory so that our isort config is picked up.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MartinHjelmare MartinHjelmare merged commit 87425d4 into home-assistant:dev Aug 30, 2020
Dev automation moved this from Reviewer approved to Done Aug 30, 2020
springstan pushed a commit that referenced this pull request Aug 30, 2020
@Mariusthvdb Mariusthvdb deleted the patch-16 branch August 31, 2020 08:58
leikoilja pushed a commit to leikoilja/core that referenced this pull request Sep 6, 2020
…assistant#39310)

* add device_class: safety to storage binary_sensors

* Update binary_sensor.py

* Update homeassistant/components/synology_dsm/binary_sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update binary_sensor.py

* Import device_class Safety

from homeassistant.components.binary_sensor

* Update binary_sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
leikoilja pushed a commit to leikoilja/core that referenced this pull request Sep 6, 2020
@Mariusthvdb
Copy link
Contributor Author

Mariusthvdb commented Sep 7, 2020

Hey @MartinHjelmare

shouldn't we change this

too now the device_class: safety is set in this PR?

@MartinHjelmare
Copy link
Member

Yes, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants