-
Notifications
You must be signed in to change notification settings - Fork 1
/
mobile_client_internet.py
44 lines (32 loc) · 1.32 KB
/
mobile_client_internet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import logging
import argparse
from pysecur3.webclient import MCPWebClient
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Script for communicating the BiSecur Gateway via the BiSecur Home portal. Needs valid credentials!')
parser.add_argument('deviceid', help='Device ID obtained from BiSecur Home portal')
parser.add_argument('password', help='Password for the device ID obtained from BiSecur Home portal')
parser.add_argument('gateway_mac', help='MAC address of the target BiSecur Gateway')
args = parser.parse_args()
logging.basicConfig(level=logging.INFO)
device_id = args.deviceid.replace('-','').replace(':','')
password = args.password
gateway_mac = bytes.fromhex(args.gateway_mac.replace(':','').replace(' ',''))
cli = MCPWebClient(device_id, password, gateway_mac)
print('Listing available gateways for the account..')
gws = cli.list_gws()
print(gws)
print('Listing status of the available gateways')
gwstatus = cli.get_gw_status()
print(gwstatus)
print('Getting MAC address of the selected gateway')
mac = cli.get_mac()
print(mac)
print('Getting gateway name')
name = cli.get_name()
print(name)
print('Getting gateway name')
cli.login('alma','password')
print(name)
#print('Getting version number of the selected gateway')
#version = cli.get_gw_version()
#print(version)