Browse Source

Merge branch '7rc0' into 'master'

Hotfix for incorrect doc

See merge request sun/pyfbx!15
dev
Laurent 3 years ago
parent
commit
a98a2de67f
  1. 32
      README.md
  2. 2
      setup.py

32
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,10 +102,21 @@ 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.
### Advanced
You can run any commands on the freebox and retrieve complete result or single value
@ -113,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
```
@ -132,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
```
@ -153,9 +156,6 @@ pyfbx -c 'System.Get_the_current_system_info()' -c 'Connection.Get_the_current_C
Telegraf http listener v2 input plugin with json format can be used to plot data in realtime.
_Note_ : Don't forget to escape token and command with quotes.
### Telegraf plots
You can use a telegraph configuration in /etc/telegraf/telegraf.d/freebox:

2
setup.py

@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name="pyfbx",
version="0.0.6",
version="0.0.7rc0",
description="Freebox thin client",
long_description=(pathlib.Path(__file__).parent / "README.md").read_text(),
long_description_content_type='text/markdown',

Loading…
Cancel
Save