Added auto get for application, cli and core data
This commit is contained in:
parent
4d5fd60ef3
commit
6d54150f06
@ -1,8 +0,0 @@
|
||||
+++
|
||||
title = "Broadlink"
|
||||
date = "2018-10-26"
|
||||
+++
|
||||
|
||||
# Broadlink
|
||||
|
||||
|
||||
49
content/applications/broadlink/_index.md
Normal file
49
content/applications/broadlink/_index.md
Normal file
@ -0,0 +1,49 @@
|
||||
+++
|
||||
title = "Broadlink"
|
||||
date = "2018-08-06T13:43:48.000Z"
|
||||
+++
|
||||
The broadlink app will output all found devices on start, you can use this to setup your config file as shown bellow
|
||||
|
||||
Config Setup example
|
||||
|
||||
```
|
||||
class Config(ConfigObject):
|
||||
|
||||
def setup(self):
|
||||
# Broadlink devices --------------------------------------------------------
|
||||
self.broadlink_livingroom = EventObject("broadlink", "064cdf434ead4")`
|
||||
|
||||
# WebApp -------------------------------------------------------------------
|
||||
self.webapp_livingroom_tv_on = EventObject("webapp", "livingroom.tv.on", "true")
|
||||
|
||||
def process_event(self):
|
||||
if self.webapp_livingroom_tv_on.event == "true":
|
||||
self.broadlink_livingroom.set("26008403120a110b0e0f0d0f0d100d2c110b0d100d0f0d0f0d100d0f0e0f0d0f0d0f0e2b1309"
|
||||
"0e0f0d100d0f0e0e0e0f0d0f110c0d2b0e0f0d2c0f290e2b0e2b120a120b11280d0f0d2c0e2b"
|
||||
"0e2b0e2a0e0f11280e00097876350f0d0e2b120a0d100d0f0d100d0f120a0d100d0f0d100e0"
|
||||
"e0e0f0d2b0e0f110b0d100d0f120a120b0d0f0d100e0e0d2c0e0e0e0f0d0f0d100e0e0e0e13"
|
||||
"090e0f0d2c0e0f0d2b132613260f2a0e0e120a0f2a0e0f0d2c112713260e2b120a0e2b130009")
|
||||
```
|
||||
|
||||
To lear a ir code send "learning" event to a broadlink device, aim you remote towards the broadlink device and
|
||||
push the button you which to learn.
|
||||
|
||||
You will then get an event back from the broadlink app with the code, cut and past that into your config file
|
||||
as showed above
|
||||
|
||||
Learning event example
|
||||
|
||||
```
|
||||
class Config(ConfigObject):
|
||||
|
||||
def setup(self):
|
||||
# Broadlink devices --------------------------------------------------------
|
||||
self.broadlink_livingroom = EventObject("broadlink", "064cdf434ead4")`
|
||||
|
||||
# WebApp -------------------------------------------------------------------
|
||||
self.webapp_livingroom_learn = EventObject("webapp", "livingroom.broadling.learn", "true")
|
||||
|
||||
def process_event(self):
|
||||
if self.webapp_livingroom_learn.event == "true":
|
||||
self.broadlink_livingroom.set("learning")
|
||||
```
|
||||
9
content/applications/broadlink/changelog.md
Normal file
9
content/applications/broadlink/changelog.md
Normal file
@ -0,0 +1,9 @@
|
||||
+++
|
||||
title = "Changelog"
|
||||
date = "2018-08-06T13:43:48.000Z"
|
||||
+++
|
||||
### v1.0
|
||||
Basic function like send ir/rf codes and learning ir/rf codes works now
|
||||
|
||||
### v0.5
|
||||
Sending ir/rf codes works now
|
||||
@ -1,9 +0,0 @@
|
||||
+++
|
||||
title = "Huee"
|
||||
date = "2018-10-26"
|
||||
Weight=2
|
||||
+++
|
||||
|
||||
# Huee
|
||||
|
||||
|
||||
4
content/applications/huee/_index.md
Normal file
4
content/applications/huee/_index.md
Normal file
@ -0,0 +1,4 @@
|
||||
+++
|
||||
title = "Huee"
|
||||
date = "2018-08-06T13:14:07.000Z"
|
||||
+++
|
||||
4
content/applications/huee/changelog.md
Normal file
4
content/applications/huee/changelog.md
Normal file
@ -0,0 +1,4 @@
|
||||
+++
|
||||
title = "Changelog"
|
||||
date = "2018-08-06T13:14:07.000Z"
|
||||
+++
|
||||
@ -1,8 +0,0 @@
|
||||
+++
|
||||
title = "WebApp"
|
||||
date = "2018-10-26"
|
||||
+++
|
||||
|
||||
# Webapp
|
||||
|
||||
|
||||
4
content/applications/webapp/_index.md
Normal file
4
content/applications/webapp/_index.md
Normal file
@ -0,0 +1,4 @@
|
||||
+++
|
||||
title = "Webapp"
|
||||
date = "2018-10-23T20:28:25.000Z"
|
||||
+++
|
||||
9
content/applications/webapp/changelog.md
Normal file
9
content/applications/webapp/changelog.md
Normal file
@ -0,0 +1,9 @@
|
||||
+++
|
||||
title = "Changelog"
|
||||
date = "2018-10-23T20:28:25.000Z"
|
||||
+++
|
||||
### v0.10
|
||||
Updated web UI, we now group the buttons with color and som style update on buttons
|
||||
|
||||
### v0.5
|
||||
Toggle and trigger buttons are auto generated and you can disable triggers by sending a false event
|
||||
@ -1,8 +0,0 @@
|
||||
+++
|
||||
title = "Zwave"
|
||||
date = "2018-10-26"
|
||||
+++
|
||||
|
||||
# Zwave
|
||||
|
||||
|
||||
4
content/applications/zwave/_index.md
Normal file
4
content/applications/zwave/_index.md
Normal file
@ -0,0 +1,4 @@
|
||||
+++
|
||||
title = "Zwave"
|
||||
date = "2018-08-06T12:01:09.000Z"
|
||||
+++
|
||||
4
content/applications/zwave/changelog.md
Normal file
4
content/applications/zwave/changelog.md
Normal file
@ -0,0 +1,4 @@
|
||||
+++
|
||||
title = "Changelog"
|
||||
date = "2018-08-06T12:01:09.000Z"
|
||||
+++
|
||||
@ -1,7 +1,5 @@
|
||||
+++
|
||||
title = "CLI"
|
||||
date = "2018-10-28"
|
||||
Weight=4
|
||||
weight = 7
|
||||
date = "2018-08-06T11:09:51.000Z"
|
||||
+++
|
||||
|
||||
TEST
|
||||
|
||||
4
content/cli/changelog.md
Normal file
4
content/cli/changelog.md
Normal file
@ -0,0 +1,4 @@
|
||||
+++
|
||||
title = "Changelog"
|
||||
date = "2018-08-06T11:09:51.000Z"
|
||||
+++
|
||||
6
content/core/_index.md
Normal file
6
content/core/_index.md
Normal file
@ -0,0 +1,6 @@
|
||||
+++
|
||||
title = "Core"
|
||||
head = "<label>Modules</label>"
|
||||
weight = 5
|
||||
date = "2018-08-06T20:43:20.000Z"
|
||||
+++
|
||||
18
content/core/changelog.md
Normal file
18
content/core/changelog.md
Normal file
@ -0,0 +1,18 @@
|
||||
+++
|
||||
title = "Changelog"
|
||||
date = "2018-08-06T20:43:20.000Z"
|
||||
+++
|
||||
### v1.2
|
||||
|
||||
* Changed from plain text message to json message
|
||||
* Fixed init request
|
||||
|
||||
### v1.1
|
||||
|
||||
* Added init and refresh request support
|
||||
* Readme file updated
|
||||
|
||||
### v1.0
|
||||
|
||||
* First release
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
+++
|
||||
title = "Hardware"
|
||||
weight=6
|
||||
weight = 8
|
||||
alwaysopen = true
|
||||
head = "<label>Addon</label>"
|
||||
+++
|
||||
|
||||
TEST
|
||||
|
||||
54
get_app_data.py
Executable file
54
get_app_data.py
Executable file
@ -0,0 +1,54 @@
|
||||
#!/bin/python
|
||||
import requests
|
||||
import sys
|
||||
import os
|
||||
|
||||
apps = {"broadlink": "68", "zwave": "60", "huee": "62", "webapp": "59"}
|
||||
headers = {"PRIVATE-TOKEN": sys.argv[1]}
|
||||
|
||||
# Core
|
||||
date = requests.get('https://git.cmtec.se/api/v4/projects/58/repository/commits/master', headers=headers).json()["committed_date"]
|
||||
readme = requests.get('https://git.cmtec.se/api/v4/projects/58/repository/files/README.md/raw?ref=master', headers=headers).text
|
||||
changelog = requests.get('https://git.cmtec.se/api/v4/projects/58/repository/files/CHANGELOG.md/raw?ref=master', headers=headers).text
|
||||
|
||||
meta_readme = '+++\ntitle = "Core"\nhead = "<label>Modules</label>"\nweight = 5\ndate = "' + date + '"\n+++\n'
|
||||
meta_changelog = '+++\ntitle = "Changelog"\ndate = "' + date + '"\n+++\n'
|
||||
|
||||
if not os.path.exists("content/core"):
|
||||
os.makedirs("content/core")
|
||||
with open('content/core/_index.md', 'w') as file:
|
||||
file.write(meta_readme + readme)
|
||||
with open('content/core/changelog.md', 'w') as file:
|
||||
file.write(meta_changelog + changelog)
|
||||
|
||||
# CLI
|
||||
date = requests.get('https://git.cmtec.se/api/v4/projects/69/repository/commits/master', headers=headers).json()["committed_date"]
|
||||
readme = requests.get('https://git.cmtec.se/api/v4/projects/69/repository/files/README.md/raw?ref=master', headers=headers).text
|
||||
changelog = requests.get('https://git.cmtec.se/api/v4/projects/69/repository/files/CHANGELOG.md/raw?ref=master', headers=headers).text
|
||||
|
||||
meta_readme = '+++\ntitle = "CLI"\nweight = 7\ndate = "' + date + '"\n+++\n'
|
||||
meta_changelog = '+++\ntitle = "Changelog"\ndate = "' + date + '"\n+++\n'
|
||||
|
||||
if not os.path.exists("content/cli"):
|
||||
os.makedirs("content/cli")
|
||||
with open('content/cli/_index.md', 'w') as file:
|
||||
file.write(meta_readme + readme)
|
||||
with open('content/cli/changelog.md', 'w') as file:
|
||||
file.write(meta_changelog + changelog)
|
||||
|
||||
# Applications
|
||||
for app in apps.keys():
|
||||
date = requests.get('https://git.cmtec.se/api/v4/projects/' + apps[app] + '/repository/commits/master', headers=headers).json()["committed_date"]
|
||||
readme = requests.get('https://git.cmtec.se/api/v4/projects/' + apps[app] + '/repository/files/README.md/raw?ref=master', headers=headers).text
|
||||
changelog = requests.get('https://git.cmtec.se/api/v4/projects/' + apps[app] + '/repository/files/CHANGELOG.md/raw?ref=master', headers=headers).text
|
||||
|
||||
meta_readme = '+++\ntitle = "' + app[0].upper() + app[1:] + '"\ndate = "' + date + '"\n+++\n'
|
||||
meta_changelog = '+++\ntitle = "Changelog"\ndate = "' + date + '"\n+++\n'
|
||||
|
||||
if not os.path.exists("content/applications/" + app):
|
||||
os.makedirs("content/applications/" + app)
|
||||
with open('content/applications/' + app + '/_index.md', 'w') as file:
|
||||
file.write(meta_readme + readme)
|
||||
with open('content/applications/' + app + '/changelog.md', 'w') as file:
|
||||
file.write(meta_changelog + changelog)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user