Ejemplo n.º 1
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
This example can be run safely as it won't change anything in your box configuration
'''
from freepybox import Freepybox

# Instantiate Freepybox class using default application descriptor
# and default token_file location
fbx = Freepybox()

# Connect to the freebox with default http protocol
# and default port 80
# Be ready to authorize the application on the Freebox if you use this
# example for the first time
fbx.open('mafreebox.freebox.fr', 80)

# Extract phone config using connection API
'''
[   {   'gain_rx': 50,
        'gain_tx': 50,
        'hardware_defect': False,
        'id': 1,
        'is_ringing': False,
        'on_hook': True,
        'type': 'fxs',
        'type_id': 1,
        'vendor': 'unknown'},
        
    {   'gain_rx': 0,
        'gain_tx': 0,
Ejemplo n.º 2
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Displays a summary of status information
Created by pagecp (github) based on example-wan.py
'''
from freepybox import Freepybox
import time
import locale

locale.setlocale(locale.LC_ALL, str('fr_FR.UTF-8'))

# Instantiate Freepybox class using default application descriptor
# and default token_file location
fbx = Freepybox()

# Connect to the freebox with default http protocol
# and default port 80
# Be ready to authorize the application on the Freebox if you use this
# example for the first time
fbx.open('192.168.0.254', 443)

print('______________________________________________________________________')
print('')
print('                      Etat de la Freebox')
print('______________________________________________________________________')
print('')
print('')
print('Informations générales :')
print('========================')
print('')