Browse Source

Doc updated with new CLI opts

7rc0
Laurent Kislaire 3 years ago
parent
commit
b94e3da287
  1. 27
      README.md

27
README.md

@ -94,7 +94,7 @@ optional arguments:
First, register the application:
```shell
$ pyfbx SuperAppId
$ pyfbx -a SuperAppId
```
Once registration is done on the device, write down the application token.
You can also create a file with token as first line and application Id as second.
@ -102,8 +102,17 @@ You can also create a file with token as first line and application Id as second
Using this app token, acquire a session token to execute a test command.
```shell
$ pyfbx -t '<TOKEN>' SuperAppId
$ pyfbx -t 'f:<TOKEN_FILE>' SuperAppId
$ pyfbx -t '<TOKEN>' -a SuperAppId
$ cat token.txt
2OUDy4hhM/KLQ7ru+70gfi83h5A4DUoOpDztOfqM4c2wuUiWJ+gXTHB1SbxHAFP7
SuperAppId
$ pyfbx -t f:token.txt -c 'Connection.Get_the_current_Connection_status()'
{ 'bandwidth_down': 1000000000,
[..]
'state': 'up',
'type': 'ethernet'}
```
_Note_ : Don't forget to escape token and command with quotes.
@ -115,16 +124,10 @@ You can run any commands on the freebox and retrieve complete result or single v
$ pyfbx -t f:/home/foo/token.txt SuperAppId -c 'Contacts.Create_a_contact(\
post_data={"display_name": "Sandy Kilo", "first_name": "Sandy", "last_name":"Kilo"})'
{ 'birthday': '',
'company': '',
'display_name': 'Sandy Kilo',
'first_name': 'Sandy',
'id': 17,
'last_name': 'Kilo',
'last_update': 1554378898,
'notes': '',
[..]
'photo_url': ''}
$ pyfbx -u https://0s2efr3i.fbxos.fr:15628 id -c "Connection.Get_the_current_Connection_status()['rate_up']" -t f:token.txt
$ pyfbx -u https://0s2efr3i.fbxos.fr:15628 -c "Connection.Get_the_current_Connection_status()['rate_up']" -t f:token.txt
1700
```
@ -134,8 +137,6 @@ With the delay option, commands can be sent cyclically:
$ pyfbx -d 1 -c "Connection.Get_the_current_Connection_status()['rate_up']" -t f:token.txt
42460
50710
58890
53120
53400
```

Loading…
Cancel
Save