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

Use more human-readable sensor names in Airly #86893

Merged
merged 2 commits into from
Jan 30, 2023
Merged

Use more human-readable sensor names in Airly #86893

merged 2 commits into from
Jan 30, 2023

Conversation

bieniu
Copy link
Member

@bieniu bieniu commented Jan 29, 2023

Breaking change

Proposed change

Use more human-readable sensor names.

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)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@@ -80,15 +80,15 @@ class AirlySensorEntityDescription(SensorEntityDescription):
AirlySensorEntityDescription(
key=ATTR_API_PM1,
device_class=SensorDeviceClass.PM1,
name=ATTR_API_PM1,
name="Particulate matter 1.0",
Copy link
Member

Choose a reason for hiding this comment

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

These names are pretty long, wouldn't PM 2.0 be easier to deal with in the UI?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at several other air quality integrations, they generally seem to name the sensor PM1.0, PM2.5, etc. (no space) so seems like that would be the most consistent way.

Copy link
Member Author

@bieniu bieniu Jan 30, 2023

Choose a reason for hiding this comment

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

As suggested, I changed these names. I also reverted CAQI (instead of Common Air Quality Index) because that name is also very long.

Side note:
Three other integrations use the names Particulate matter x.x: tomorrowio, tuya and nam.

Copy link
Member

Choose a reason for hiding this comment

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

With a backend language in place it's the goal to eventually offer standard, pre-translated names for this.

@packruler
Copy link

packruler commented Jan 29, 2023

These name changes seem questionable at first glance but I will defer to more knowledgeable devs for that decision.

That said if they are valid they should be made in the const.py file with new and/or updated ATTR value references.

P.S. Considering there are multiple components that refer to the same type of data around air quality it might be worth discussing standardizing those names in homeassistant.const. 🤔 I could see this simplifying and standardizing the naming and translations globally. That said I am just getting started in Home Assistant development and this topic may have been discussed elsewhere.

@balloob balloob merged commit 5f57648 into home-assistant:dev Jan 30, 2023
@bieniu bieniu deleted the airly-sensor-names branch January 30, 2023 14:08
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2023
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