Enabling LTE sensors readout#242
Closed
teixeluis wants to merge 17 commits intoAlexandrErohin:mainfrom
Closed
Conversation
Contributor
Author
|
PR from the router lib: AlexandrErohin/TP-Link-Archer-C6U#98 |
| icon="mdi:wan", | ||
| value=lambda status: status.conn_type, | ||
| ), | ||
| TPLinkRouterSensorEntityDescription( |
Owner
There was a problem hiding this comment.
Don't forget about compatibility for all routers. Most routers do not have LTE. Only some routers has. So for the most routers these sensors would be Unavailable. It is better to add these sensors separately for LTE routers
Owner
|
I have added those sensors only for LTE rputers, please try the latest version |
Contributor
Author
Contributor
Author
|
Fyi the improvements I mentioned in this PR, I have then covered in this new one: it covers:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I found and commented in this issue that LTE integration code appeared to be already WIP in this project and the related lib.
Therefore in this PR I decided to close the gap, and implement the necessary changes to cover the retrieval of the LTE / cellular related attributes. For simplicity I have centralized the data retrieval around the existing get_status() function, and have slightly reorganized the data classes in the lib, in order to preserve the segregation of categories while at the same time aggregate these for hassio integration as a single top level State object. This way the simplicity of the sensor.py module is preserved.
Have been able to test the feature in my TL-MR105 device, and as expected it exposes the existing and new attributes:
Meanwhile I have identified some improvements to take care of, such as the SNR value be properly converted (needs to be divided by 10), the signal level which does not seem to be correctly represented, and fields like "LTE Network Type", "LTE SIM Status", "LTE Connection Status" which should be mapped to the corresponding names.
The "total wired clients" field seems a bit flakey (alternates between 0 and 1 erratically) but I can confirm this was already like this before this change.