Change to properly enable LTE sensors#98
Closed
teixeluis wants to merge 2 commits intoAlexandrErohin:mainfrom
Closed
Change to properly enable LTE sensors#98teixeluis wants to merge 2 commits intoAlexandrErohin:mainfrom
teixeluis wants to merge 2 commits intoAlexandrErohin:mainfrom
Conversation
…he proper modelling of categories of attributes that may or may not occur depending on the device
Author
|
PR from the hassio integration: AlexandrErohin/home-assistant-tplink-router#242 |
This was referenced Oct 11, 2025
| status.devices = list(devices.values()) | ||
| status.clients_total = status.wired_total + status.wifi_clients_total + status.guest_clients_total | ||
|
|
||
| status = self.populate_lte_status(status) |
Owner
There was a problem hiding this comment.
Status data class should have only information general for all TP-Link models. It should not have LTE info as only some models have LTE. Most routers do not have this feature.
Author
There was a problem hiding this comment.
True, maybe move dataclasses specific to LTE elsewhere. Regarding this particular step I would challenge because if we are here (MR router) then it is an LTE enabled router.
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.
In this PR I am proposing a change to this lib that consists in reorganizing the data classes related to Status. For that effect I have defined a top level Status class which parents the RouterStatus (which contains the same attributes as the former Status class) along with IPv4Status, LTEStatus, and VPNStatus.
In the mr.py module get_status() will now call populate_lte_status() in order to populate the state attributes that are specific to the LTE enabled devices.
I will also open a PR on the hassio integration project (https://github.com/AlexandrErohin/home-assistant-tplink-router) that will require these changes.