fritz_switch_profiles
Project description
fritz-switch-profiles
A (Python) script to remotely set device profiles of an AVM Fritz!Box
Installation
git clone https://github.com/flopp/fritz-switch-profiles.git
cd fritz-switch-profiles
virtualenv -p python3 env
source env/bin/activate
pip install -r requirements.txt
Usage
usage: fritz-switch-profiles.py [-h] [--url URL] [--user USER] --password
PASSWORD [--list-devices] [--list-profiles]
[DEVICE=PROFILE [DEVICE=PROFILE ...]]
positional arguments:
DEVICE=PROFILE Desired device to profile mapping
optional arguments:
-h, --help show this help message and exit
--url URL The URL of your Fritz!Box; default: http://fritz.box
--user USER Login username; default: empty
--password PASSWORD Login password
--list-devices List all known devices
--list-profiles List all available profiles
- Determine the ID of the device, whose profile you want to change
./fritz-switch-profiles.py --password YOURPASSWORD --list-devices
->
LOGGING IN TO FRITZ!BOX AT http://fritz.box...
FETCHING AVAILABLE PROFILES...
FETCHING DEVICES...
FETCHING DEVICE PROFILES...
DEVICE_ID PROFILE_ID DEVICE_NAME
landevice5007 filtprof1 android-1234567890123456 [NOT ACTIVE]
landevice6494 filtprof1 my kid's iphone
landevice5006 filtprof2 Chromecast
...
- Determine the available profiles
./fritz-switch-profiles.py --password YOURPASSWORD --list-profiles
->
LOGGING IN TO FRITZ!BOX AT http://fritz.box...
FETCHING AVAILABLE PROFILES...
FETCHING DEVICES...
FETCHING DEVICE PROFILES...
PROFILE_ID PROFILE_NAME
filtprof1 Standard
filtprof2 Gast
filtprof3 Unbeschränkt
filtprof4 Gesperrt
- Actually change the profiles
./fritz-switch-profiles.py --password YOURPASSWORD landevice6494=filtprof4
->
LOGGING IN TO FRITZ!BOX AT http://fritz.box...
FETCHING AVAILABLE PROFILES...
FETCHING DEVICES...
FETCHING DEVICE PROFILES...
UPDATING DEVICE PROFILES...
CHANGING PROFILE OF landevice6494/my kid's iphone TO filtprof4/Gesperrt
Note that you may change the profiles of multiple devices at once by supplying multiple DEVICE=PROFILE
pairs on the command line.
Usage as a library
From example.py
from fritz_switch_profiles import FritzProfileSwitch
url = 'http://fritz.box'
user = ''
password = 'mysecurepassword'
fps = FritzProfileSwitch(url, user, password)
devices = fps.get_devices()
profiles = fps.get_profiles()
fps.print_devices()
fps.print_profiles()
profile_for_device = [devices[0]['id1'], profiles[2]['id']]
fps.set_profiles(profile_for_device)
Known Issues
- Non-uniquely named devices may confuse the script.
License
MIT © 2018 Florian Pigorsch & contributors
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for fritz-switch-profiles-1.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8d73895d2c00a85e73ad6b11f1ab24735b7aeb0ee346991ca97769bc50e4ed1 |
|
MD5 | 49be8c29fe71deda25fad1786a84b973 |
|
BLAKE2b-256 | d5f46869b6b276b4ac4257b344c975d9cccdf1de74dc737371d4577b300fb07b |
Close
Hashes for fritz_switch_profiles-1.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 130a6b52f6f4f31785dc2488b10d0f2036aa3476a48cad88deec8a25f4dcdf59 |
|
MD5 | d35dfb8a4c44ba45daed7bfba11be3ea |
|
BLAKE2b-256 | f59ff03badcaec21ac35b5100c0d8b99c69d7a994d67d481e76f413713a2f0e4 |