8000 Add Rituals Perfume Genie sensor platform by milanmeu · Pull Request #48270 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Rituals Perfume Genie sensor platform #48270

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

Merged
merged 12 commits into from
Apr 11, 2021

Conversation

milanmeu
Copy link
Contributor
@milanmeu milanmeu commented Mar 23, 2021

Proposed change

This PR adds the sensor platform to the rituals_perfume_genie integration.

  • Add entity.py for new DiffuserEntity class:
    • DiffuserSwitch extends DiffuserEntity
    • Remove duplicate functions from DiffuserEntity
  • Add DataUpdateCoordinator:
    • Create and register DataUpdateCoordinator
    • Remove async_update from DiffuserSwitch
  • Add new sensor platform:
    • Add sensor.py
    • Add sensor to async_forward_entry_setup
  • Add new consts to const.py

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

Additional information

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:

8000

Copy link
Member
@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

Please see comment above

@hmmbob
Copy link
Contributor
hmmbob commented Apr 4, 2021

Verified - current code is successfully adding new sensors for Genie v2 (which does not have a battery)

image

Copy link
Member
@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

Please see comments above

@milanmeu milanmeu force-pushed the add-rituals-sensor-platform branch from 3a78e0f to d7c96ca Compare April 4, 2021 21:18
@milanmeu
Copy link
Contributor Author
milanmeu commented Apr 5, 2021

I made the requested changes and had to do a rebase for d7c96ca.

Failing tests:

FAILED tests/components/prometheus/test_init.py::test_view[pyloop] - assert '...
ERROR tests/components/shelly/test_config_flow.py::test_form[pyloop] - Runtim...

Copy link
Member
@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

Please resolve conflicts. Thanks!

Copy link
Member
@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

Please remove the icon for any entity with device_class

https://developers.home-assistant.io/docs/core/entity/#advanced-properties

milanmeu and others added 2 commits April 11, 2021 13:29
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
Copy link
Member
@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@bdraco bdraco merged commit 71e0e42 into home-assistant:dev Apr 11, 2021
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.

Please address the comments in a new PR. Thanks!

def extra_state_attributes(self):
"""Return the wifi state attributes."""
return {
ATTR_SIGNAL_STRENGTH: self.coordinator.data[HUB][SENSORS][WIFI][TITLE],
Copy link
Member

Choose a reason for hiding this comment

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

What measurement is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as the battery. The description of the state as shown in the app: low, medium, ...

Copy link
Member

Choose a reason for hiding this comment

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

Remove it completely or make it a separate sensor entity.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0