Library to retrieve information from a Telstra Smart Modem.
Project description
Telstra Smart Modem - Python library
This library provides a Python 3 interface to query information from a Telstra Smart Modem (Gen 2).
Tested with
- Telstra Smart Modem (Gen 2):
- Model: Technicolor DJA0231
- Firmware: 18.1.c.0443-950-RB
Current features
- Retrieving online status (Online, Backup & Offline)
- Retrieving connected devices:
- Checking if a device is connected
- Retrieving information of seen device's (ipv4, ipv6, hostname, mac, connection type, ethernet port)
Links
Installation
Requirements
Methods
PIP
pip install telstra-smart-modem
Usage
Initialization
import telstra_smart_modem
IP = '192.168.0.1'
USERNAME = 'admin'
PASSWORD = 'Telstra'
# Create tsm (Telstra Smart Modem) modem object:
tsm = telstra_smart_modem.Modem(IP, USERNAME, PASSWORD)
Devices
# Get current devices object from modem:
>>> clients = tsm.getDevices()
# Get list of seen devices:
>>> clients.devices
[
{
'online': False,
'hostname': 'host1',
'ipv4': None,
'ipv6': [],
'mac': '00:00:00:00:00:01',
'connection': 'wireless - 5GHz',
'eth-port': None
},
{
'online': True,
'hostname': 'host2',
'ipv4': '192.168.0.3',
'ipv6': [
'2001:0db8:0000:0000:0000:8a2e:0370:7334'
],
'mac': '00:00:00:00:00:02',
'connection': 'ethernet',
'eth-port': 2
}
]
# Get specific device by mac address:
>>> clients.getDevice("00:00:00:00:00:01")
{
'online': False,
'hostname': 'host1',
'ipv4': None,
'ipv6': [],
'mac': '00:00:00:00:00:01',
'connection': 'ethernet',
'eth-port': 2
}
# Check if a device is currently connected:
>>> clients.isOnline("00:00:00:00:00:02")
True
>>> clients.isOnline("11:11:11:11:11:11")
False
Online status
# Returns 'online' if the modem is connected through the WAN port.
# Returns 'backup' if the WAN connection is down and the 4G backup is active.
# Returns 'offline' if both the WAN and 4G connections are down.
>>> tsm.getModemStatus()
online
Project details
Release history Release notifications | RSS feed
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 telstra-smart-modem-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d581c31e9573d4ac94bfe62f478e5dd66cc93ec3f9535c62f9eb88f1858702cd |
|
MD5 | 5d3d2c855896029b099179e75f83aafa |
|
BLAKE2b-256 | 9dcf56094aa6f0f93fe23c94cccbf874f622419591435c81661d873045592a03 |
Close
Hashes for telstra_smart_modem-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2a03a4910797fc8e45fb6ad6f7bff435a1dffec5db82800e180d62cfcba1adf |
|
MD5 | 28539899cc3ad847762cd89d82fb0625 |
|
BLAKE2b-256 | fbdf0bb7c16053994e2c4110f7567ed31b9d10c6d6400f30d6460e4549b9c9fa |