Skip to content

Commit

Permalink
Modernize Huawei LTE (home-assistant#26675)
Browse files Browse the repository at this point in the history
* Modernization rework

- config entry support, with override support from huawei_lte platform in YAML
- device tracker entity registry support
- refactor for easier addition of more features
- internal code cleanups

* Remove log level dependent subscription/data debug hack

No longer needed, because pretty much all keys from supported
categories are exposed as sensors.

Closes home-assistant#23819

* Upgrade huawei-lte-api to 1.4.1

https://github.com/Salamek/huawei-lte-api/releases

* Add support for access without username and password

* Use subclass init instead of config_entries.HANDLERS

* Update huawei-lte-api to 1.4.3 (home-assistant#27269)

* Convert device state attributes to snake_case

* Simplify scanner entity initialization

* Remove not needed hass reference from Router

* Return explicit None from unsupported old device tracker setup

* Mark unknown connection errors during config as such

* Drop some dead config flow code

* Run config flow sync I/O in executor

* Parametrize config flow login error tests

* Forward entry unload to platforms

* Async/sync fixups

* Improve data subscription debug logging

* Implement on the fly add of new and tracking of seen device tracker entities

* Handle device tracker entry unload cleanup in component

* Remove unnecessary _async_setup_lte, just have code in async_setup_entry

* Remove time tracker on unload

* Fix to not use same mutable default subscription set for all routers

* Pylint fixes

* Remove some redundant defensive device tracker code

* Add back explicit get_scanner None return, hush pylint

* Adjust approach to set system_options on entry create

* Enable some sensors on first add instead of disabling everything

* Fix SMS notification recipients default value

* Add option to skip new device tracker entities

* Fix SMS notification recipient option default

* Work around pylint-dev/pylint#3202

* Remove unrelated type hint additions

* Change async_add_new_entities to a regular function

* Remove option to disable polling for new device tracker entries
  • Loading branch information
scop authored and tetienne committed Nov 20, 2019
1 parent b4e5fb1 commit cbcf85b
Show file tree
Hide file tree
Showing 15 changed files with 1,078 additions and 287 deletions.
39 changes: 39 additions & 0 deletions homeassistant/components/huawei_lte/.translations/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"config": {
"abort": {
"already_configured": "This device is already configured"
},
"error": {
"connection_failed": "Connection failed",
"incorrect_password": "Incorrect password",
"incorrect_username": "Incorrect username",
"incorrect_username_or_password": "Incorrect username or password",
"invalid_url": "Invalid URL",
"login_attempts_exceeded": "Maximum login attempts exceeded, please try again later",
"response_error": "Unknown error from device",
"unknown_connection_error": "Unknown error connecting to device"
},
"step": {
"user": {
"data": {
"password": "Password",
"url": "URL",
"username": "User name"
},
"description": "Enter device access details. Specifying username and password is optional, but enables support for more integration features. On the other hand, use of an authorized connection may cause problems accessing the device web interface from outside Home Assistant while the integration is active, and the other way around.",
"title": "Configure Huawei LTE"
}
},
"title": "Huawei LTE"
},
"options": {
"step": {
"init": {
"data": {
"recipient": "SMS notification recipients",
"track_new_devices": "Track new devices"
}
}
}
}
}

0 comments on commit cbcf85b

Please sign in to comment.