Skip to content

More sensors for SMS integration#70486

Merged
balloob merged 6 commits intohome-assistant:devfrom
PaulAnnekov:sms_sensors
Jun 29, 2022
Merged

More sensors for SMS integration#70486
balloob merged 6 commits intohome-assistant:devfrom
PaulAnnekov:sms_sensors

Conversation

@PaulAnnekov
Copy link
Copy Markdown
Contributor

@PaulAnnekov PaulAnnekov commented Apr 23, 2022

Breaking change

GSM signal sensor entity was replaced with a set of more granular ones. It will become unavailable after update.

Proposed change

Currently SMS integration exposes only a single entity with 3 attributes. It shows signal strength. As it's not enough to understand what happens with mobile modem, I've added more entities that report: network name, cell id, network code, etc. Also, moved attributes of signal entity to separate entities as it makes UX better.

New entities:
New entities

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

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 @ocalvo, mind taking a look at this pull request as it has been labeled with an integration (sms) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@PaulAnnekov PaulAnnekov marked this pull request as ready for review April 23, 2022 18:32
Copy link
Copy Markdown

@jorhett jorhett left a comment

Choose a reason for hiding this comment

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

Best written PR description I've seen today.

I have no means to test/evaluate the code in question, but it is more readable than the code it replaces which is always a plus.

Copy link
Copy Markdown
Contributor

@ocalvo ocalvo left a comment

Choose a reason for hiding this comment

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

Thank you for doing this.

@ocalvo
Copy link
Copy Markdown
Contributor

ocalvo commented Apr 23, 2022

Best written PR description I've seen today.

I have no means to test/evaluate the code in question, but it is more readable than the code it replaces which is always a plus.

This may have a merge conflict with #68320

@PaulAnnekov
Copy link
Copy Markdown
Contributor Author

PaulAnnekov commented Apr 24, 2022

@ocalvo looks not difficult to merge. Let's see which PR will be merged into dev first))).

@ocalvo
Copy link
Copy Markdown
Contributor

ocalvo commented May 9, 2022

Keep alive

@ocalvo
Copy link
Copy Markdown
Contributor

ocalvo commented May 26, 2022

@PaulAnnekov can you fix the merge conflicts?

@PaulAnnekov
Copy link
Copy Markdown
Contributor Author

@ocalvo will do

@PaulAnnekov
Copy link
Copy Markdown
Contributor Author

@ocalvo merged

@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label Jun 22, 2022
]

SIGNAL_SENSORS: Final[dict[str, SensorEntityDescription]] = {
"SignalStrength": SensorEntityDescription(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For a future PR, you can add state_class=MEASUREMENT for this and others so stats are being generated

),
}

NETWORK_SENSORS: Final[dict[str, SensorEntityDescription]] = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If the dict keys are not used, why are these dicts and not tuples?

@balloob balloob merged commit 551929a into home-assistant:dev Jun 29, 2022
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.

Please address the comment in a new PR. Thanks!

{"value": "115200", "label": "115200"},
]

SIGNAL_SENSORS: Final[dict[str, SensorEntityDescription]] = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please move the sensor entity descriptions to the sensor platform. These are platform details.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

breaking-change cla-signed integration: sms new-feature smash Indicator this PR is close to finish for merging or closing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants