3 Commits f150b00668 ... 81eadd190c

Author SHA1 Message Date
  boyska 81eadd190c fix readme 4 months ago
  boyska 22522dbcf8 import at the beginning of file 4 months ago
  boyska b33fc4464f add dependencies 4 months ago
3 changed files with 10 additions and 6 deletions
  1. 5 5
      README.md
  2. 4 0
      requirements.txt
  3. 1 1
      sergio.py

+ 5 - 5
README.md

@@ -10,21 +10,21 @@ It can be used both as a library and as a CLI program.
 ### Read variable value
 
 ```
-sergio --baud 19200 get PS
+./sergio.py get PS
 ONDAROSS
 ```
 
 To make it machine readable, just use `--output json`
 
 ```
-sergio --output json --baud 19200 get PS
+./sergio.py --output json get PS
 {"variable": "PS", "value": "ONDAROSS"}
 ```
 
 ### Set the radiotext
 
 ```
-sergio --baud 19200 set RT1 'www.ondarossa.info'
+./sergio.py set RT1 'www.ondarossa.info'
 ```
 
 ### Synchronize time and date
@@ -32,7 +32,7 @@ sergio --baud 19200 set RT1 'www.ondarossa.info'
 This assumes your computer has a correct time and date of course.
 
 ```
-sergio --baud 19200 synctime Europe/Rome
+./sergio.py synctime Europe/Rome
 ```
 
 You can also specify `--save` so that this is saved immediately.
@@ -40,7 +40,7 @@ You can also specify `--save` so that this is saved immediately.
 ### Dump everything
 
 ```
-sergio --baud 19200 dump > dump.json
+./sergio.py dump > dump.json
 ```
 
 

+ 4 - 0
requirements.txt

@@ -0,0 +1,4 @@
+pyserial==3.5
+
+pytz==2022.7.1
+

+ 1 - 1
sergio.py

@@ -8,6 +8,7 @@ from typing import Union
 import logging
 import json
 import enum
+from datetime import datetime
 
 
 VARIABLES = [
@@ -283,7 +284,6 @@ def main_dump(args, pira: Pira):
 
 
 def main_synctime(args, pira: Pira):
-    from datetime import datetime
     from pytz import timezone
 
     tz = timezone(args.timezone)