Skip to content

Convert ecobee pressure to local units#51379

Merged
MartinHjelmare merged 2 commits intohome-assistant:devfrom
rianadon:ecobee-units
Jun 9, 2021
Merged

Convert ecobee pressure to local units#51379
MartinHjelmare merged 2 commits intohome-assistant:devfrom
rianadon:ecobee-units

Conversation

@rianadon
Copy link
Copy Markdown
Contributor

@rianadon rianadon commented Jun 2, 2021

Proposed change

Convert the pressure in the Ecobee weather integration to metric/imperial depending on what Home Assistant is configured to use. This is the same behavior as the OpenWeatherMap (code) and Climacell (code) weather integrations.

The pressure units from Ecobee API are undocumented, but they look like hPa or millibars (both are equal so I just chose hPa in the code). See #24524 as well.

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

⚠️ There many many more weather integrations that do not convert their pressure units to the correct format. There is probably a better solution than making each integration convert to the correct pressure unit: Something like #48641 seems like it could help.

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
Copy Markdown

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

Copy link
Copy Markdown
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!

Copy link
Copy Markdown
Contributor

@bjpetit bjpetit 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.

@MartinHjelmare MartinHjelmare merged commit d3a4e21 into home-assistant:dev Jun 9, 2021
thomasgermain pushed a commit to thomasgermain/home-assistant that referenced this pull request Jun 10, 2021
* Convert ecobee pressure to local units

* Round inHg to 2 places
@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 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.

Ecobee weather pressure units incorrect

4 participants