Skip to content

Add missing unit for signal strength#40436

Merged
MartinHjelmare merged 12 commits intohome-assistant:devfrom
chemelli74:chemelli74-unit
Oct 1, 2020
Merged

Add missing unit for signal strength#40436
MartinHjelmare merged 12 commits intohome-assistant:devfrom
chemelli74:chemelli74-unit

Conversation

@chemelli74
Copy link
Copy Markdown
Contributor

Proposed change

Using DEVICE_CLASS_SIGNAL_STRENGTH I noticed that corresponding unit was missing

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

  • 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:

Copy link
Copy Markdown
Contributor

@elupus elupus left a comment

Choose a reason for hiding this comment

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

That isn't the only unit for signal strength. So the constant should be called decibel.

@chemelli74
Copy link
Copy Markdown
Contributor Author

That isn't the only unit for signal strength. So the constant should be called decibel.

Added dBm as well.

Simone

@Misiu Misiu mentioned this pull request Sep 22, 2020
21 tasks
Comment thread homeassistant/const.py
@MartinHjelmare MartinHjelmare changed the title Missing unit for signal strength Add missing unit for signal strength Sep 22, 2020
@springstan
Copy link
Copy Markdown
Member

@chemelli74 please replace string occurrences in the entire code base with the added constant :)

@chemelli74
Copy link
Copy Markdown
Contributor Author

@chemelli74 please replace string occurrences in the entire code base with the added constant :)

ahahahah, this simple PR is getting more complex every comment :-S
I'll try to do the job in the next days.

Simone

Copy link
Copy Markdown
Member

@springstan springstan left a comment

Choose a reason for hiding this comment

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

LGTM 👍 thanks @chemelli74!

Comment thread tests/components/rfxtrx/test_sensor.py Outdated
Comment thread tests/components/huawei_lte/test_sensor.py Outdated
@chemelli74
Copy link
Copy Markdown
Contributor Author

Sorry guys for all those commits but I don't get why pre-commit doesn't detect issues when run locally.

Simone

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.

Looks good!

@MartinHjelmare
Copy link
Copy Markdown
Member

Is there a case where the measurement isn't a signal? I'd call sound a signal too.

@chemelli74
Copy link
Copy Markdown
Contributor Author

chemelli74 commented Oct 1, 2020

Is there a case where the measurement isn't a signal? I'd call sound a signal too.

So you suggest to move const to "DECIBELS" and "DECIBELS_MILLIWATT" for reusing those not only for signal but also for sound ?

@MartinHjelmare
Copy link
Copy Markdown
Member

No, I think sound can be considered a signal too.

@chemelli74
Copy link
Copy Markdown
Contributor Author

No, I think sound can be considered a signal too.

So we are good to merge ?

@MartinHjelmare
Copy link
Copy Markdown
Member

@elupus what do you think?

Copy link
Copy Markdown
Contributor

@elupus elupus left a comment

Choose a reason for hiding this comment

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

Think it looks good.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants