Skip to content

Commit

Permalink
Test timesync
Browse files Browse the repository at this point in the history
  • Loading branch information
1technophile committed Jan 30, 2023
1 parent 1be65a0 commit e06a911
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion theengsgateway/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ DISCOVERY_DEVICE_NAME | string | No | Device name `TheengsGateway`
DISCOVERY_FILTER | string | No | Excluded BLE devices models `[IBEACON,GAEN,MS-CDP]`
ADAPTER | string | No | Bluetooth adapter (e.g. hci1 on Linux)
SCANNING_MODE | string | No | Change scanning mode between `active` and `passive`, defaults to `active`
TIME_SYNC | string | No | Addresses of BLE devices to synchronize time (defaults to the empty list `[]`)
TIME_FORMAT | boolean | No | Use 12-hour (`yes`) or 24-hour (`no`) time format for clocks (defaults to `no`)

For more details please refer to [TheengsGateway](https://theengs.github.io/gateway/).
For more details please refer to [TheengsGateway](https://theengs.github.io/gateway/).
8 changes: 6 additions & 2 deletions theengsgateway/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"DISCOVERY_DEVICE_NAME": "TheengsGateway",
"DISCOVERY_FILTER": "[IBEACON,GAEN,MS-CDP]",
"ADAPTER": "",
"SCANNING_MODE": "active"
"SCANNING_MODE": "active",
"TIME_SYNC": "[]",
"TIME_FORMAT": false
},
"schema": {
"MQTT_HOST": "str",
Expand All @@ -47,6 +49,8 @@
"DISCOVERY_DEVICE_NAME": "str?",
"DISCOVERY_FILTER": "str?",
"ADAPTER": "str?",
"SCANNING_MODE": "str?"
"SCANNING_MODE": "str?",
"TIME_SYNC": "str?",
"TIME_FORMAT": "bool?"
}
}
6 changes: 5 additions & 1 deletion theengsgateway/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ DISCOVERY_TOPIC=$(bashio::config 'DISCOVERY_TOPIC')
DISCOVERY_DEVICE_NAME=$(bashio::config 'DISCOVERY_DEVICE_NAME')
DISCOVERY_FILTER=$(bashio::config 'DISCOVERY_FILTER')
ADAPTER=$(bashio::config 'ADAPTER')
TIME_SYNC=$(bashio::config 'TIME_SYNC')
TIME_FORMAT=$(bashio::config 'TIME_FORMAT')

{
echo "{"
Expand All @@ -38,7 +40,9 @@ ADAPTER=$(bashio::config 'ADAPTER')
echo " \"discovery_topic\": \"${DISCOVERY_TOPIC}\","
echo " \"discovery_device_name\": \"${DISCOVERY_DEVICE_NAME}\","
echo " \"discovery_filter\": \"${DISCOVERY_FILTER}\","
echo " \"adapter\": \"${ADAPTER}\""
echo " \"adapter\": \"${ADAPTER}\"",
echo " \"time_sync\": \"${TIME_SYNC}\"",
echo " \"time_format\": \"${TIME_FORMAT}\"",
echo "}"
} > "${CONFIG}"

Expand Down

0 comments on commit e06a911

Please sign in to comment.