Add switch platform to Fritz (#51610)
* Add switch platform to Fritz * Fix tests * Pylint * Small fix * Bump fritzprofiles to fix log level and identifier * Fix different WiFi networks with same name * Changed exposed attributes * Moved to extra_state * Remove redundant lambda * Add missing wait * Removed identifiers * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Add mapping dict * Device Profile disabled by default * Heavy cleanup * Tweak * Bug fix * Update homeassistant/components/fritz/switch.py Co-authored-by: Aaron David Schneider <aaron.schneider@nbi.ku.dk> * Fix port forward switching + small log improvement * Cleanup from old approach * Handle port mapping hot removal (from device) * Minor fixes * Typying * Removed lambda call * Last missing strict typing * Split get entities * Func rename * Move FritzBoxBaseSwitch to switch.py * Removed lambda * Update homeassistant/components/fritz/common.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/fritz/common.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Fixes after applying comments * Remvoed redundant try block * Removed broad-except * Optimized async/sync switch * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Address remaining comments * Optimize return list * More optimization for return lists * Some missing strict typing * Redundant typing * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Wrong if * Introduce const for profile status * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/fritz/switch.py Co-authored-by: J. Nick Koston <nick@koston.org> * Fix mypy * Switch back to get_local_ip() * Address latest comments Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: Aaron David Schneider <aaron.schneider@nbi.ku.dk>
This commit is contained in:
parent
897f5d9247
commit
7959225fef
8 changed files with 735 additions and 9 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
DOMAIN = "fritz"
|
||||
|
||||
PLATFORMS = ["binary_sensor", "device_tracker", "sensor"]
|
||||
PLATFORMS = ["binary_sensor", "device_tracker", "sensor", "switch"]
|
||||
|
||||
DATA_FRITZ = "fritz_data"
|
||||
|
||||
|
@ -19,6 +19,14 @@ FRITZ_SERVICES = "fritz_services"
|
|||
SERVICE_REBOOT = "reboot"
|
||||
SERVICE_RECONNECT = "reconnect"
|
||||
|
||||
SWITCH_PROFILE_STATUS_OFF = "never"
|
||||
SWITCH_PROFILE_STATUS_ON = "unlimited"
|
||||
|
||||
SWITCH_TYPE_DEFLECTION = "CallDeflection"
|
||||
SWITCH_TYPE_DEVICEPROFILE = "DeviceProfile"
|
||||
SWITCH_TYPE_PORTFORWARD = "PortForward"
|
||||
SWITCH_TYPE_WIFINETWORK = "WiFiNetwork"
|
||||
|
||||
TRACKER_SCAN_INTERVAL = 30
|
||||
|
||||
UPTIME_DEVIATION = 5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue