-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
Huawei LTE sensor improvements #84019
Conversation
They are not total increasing ones, but rather totals expected to reset monthly or on manual action.
Hey there @fphammerle, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
@@ -183,7 +215,7 @@ class HuaweiSensorEntityDescription(SensorEntityDescription): | |||
), | |||
"ltedlfreq": HuaweiSensorEntityDescription( | |||
key="ltedlfreq", | |||
name="Downlink frequency", | |||
name="LTE downlink frequency", | |||
formatter=lambda x: ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: in #83904 I noticed there were quite a few multi-line lambdas.
Is there a way they could be converted to single line lambdas or moved to stand-alone functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, at least named functions. I'm not sure multiline lambdas are a problem per se. c530a0e converts bodies of ones that are used more than once to named functions; converting ones that are used only does not seem to be a net positive to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@epenet made the requested changes, any chance for a review here? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oopsie, I forgot to submit this earlier during the holidays as I got stuck trying to understand how the last_reset
is expected to work, and frustrated when trying to understanding how all these changes are related...
To my understanding there are (at least) the following changes included in this single PR:
- New sensors: ARFCN, BSIC, Downlink frequency, Uplink frequency, Current day transfer
- Renamed sensors: downlink frequency -> lte downlink frequency, uplink frequency -> lte uplink frequency
- Refactoring: some descriptions were converted to avoid multiline lambdas
- Fixes: current month upload, current month download converted to use
last_reset
for handling reset cycles
FWIW, this looks good to me on the surface and could be merged as is, thanks @scop! Could you still update the PR description to be a bit more informative than just "various changes/improvements/fixes", even if just listing a cleaned-up version of the commit messages to help any readers to?
Fair enough, description updated. Note that we don't actually add any new sensors here, but rather add metadata about them to help HA render and utilize better a bunch of ones that were previously passed through "raw as-is" from the device API. |
ee8192c
to
6bea5c1
Compare
Let's merge it and fix whatever we missed if someone chimes in, thanks @scop! :-) |
Proposed change
Various improvements to Huawei LTE sensors.
None
NetworkModeEnum
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: