8000 Add Qingping Air Monitor Lite support support by arturdobo · Pull Request #48181 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Qingping Air Monitor Lite support support 8000 #48181

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

Conversation

arturdobo
Copy link
Contributor

Breaking change

Proposed change

Add support for Qingping Air Monitor Lite support (cgllc.airm.cgdn1)

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
air_quality:
  - platform: xiaomi_miio
    name: some-name
    host: some-host
    token: some-token

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

This pull request needs to be manually signed off by @home-assistant/core before it can get merged.
(message by ReviewEnforcer)

@probot-home-assistant
Copy link

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

@arturdobo
Copy link
Contributor Author

Btw, how other entities like temp and humidity sensors should be registered for this device? Do you have any examples for that?

@syssi
Copy link
Member
syssi commented Mar 21, 2021

The challenge is to move the "retrieve the current status/values" logic to the __init__.py (a platform called xiaomi_miio). The platform will setup the different discovered / configured devices which register multiple entities per device. A retrieved state must be dispatched to all childs/entities. If this structure is available it will be easy to add new entities like sensors, switches etc.

@arturdobo
Copy link
Contributor Author

I see. It looks like more things to do.

The air quality part of this device is sufficient for me for now, so I'll try to retrieve other measurements the way you described within another PR.

@arturdobo
Copy link
Contributor Author

Does this PR require more any further work?

Copy link
Contributor
@emontnemery emontnemery left a comment

Choose a reason for hiding this comment

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

Looks good overall, I left a suggestion to simplify the mapping between model and supporting classes.

@emontnemery emontnemery added this to the o p milestone Mar 24, 2021
@arturdobo
Copy link
Contributor Author
arturdobo commented Mar 24, 2021

@emontnemery I applied your remarks. I experienced a "using before assignment" error so I needed to use lambda on entity_class either. Could you check whether this code is idiomatic?

@arturdobo
Copy link
Contributor Author

@emontnemery could you look at it?

@emontnemery
Copy link
Contributor

Instead of the useless lambdas, can you just move the AirMonitorV1 and AirMonitorCGDN1 classes earlier?

@arturdobo
Copy link
Contributor Author

done

Copy link
Contributor
@emontnemery emontnemery left a comment

Choose a reason for hiding this comment

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

Thanks, @arturdobo 👍

@emontnemery emontnemery merged commit 68801ae into home-assistant:dev Mar 31, 2021
@frenck frenck removed this from the o p milestone Mar 31, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 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.

6 participants
0