Skip to content

Commit d014eef

Browse files
committed
Release 2.0.0
(Force Merge)
1 parent f06f111 commit d014eef

File tree

131 files changed

+6303
-2968
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+6303
-2968
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/code
5+
docker:
6+
- image: circleci/python:2.7
7+
branches:
8+
ignore:
9+
- gh-pages
10+
steps:
11+
- checkout

.circleci/assets/configurator_v1.html

Lines changed: 33 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<title>Homie for ESP8266 docs</title>
5+
6+
<meta charset="utf-8">
7+
8+
<style>
9+
body {
10+
background-color: #ef5350;
11+
}
12+
13+
#content {
14+
width: 512px;
15+
16+
margin: auto;
17+
18+
text-align: center;
19+
}
20+
21+
h1, h2, a {
22+
font-family: "Segoe UI", Helvetica, Arial, sans-serif;
23+
}
24+
25+
h1, h2 {
26+
color: white;
27+
}
28+
29+
ul {
30+
list-style-type: none;
31+
}
32+
33+
li {
34+
width: 100%;
35+
height: 50px;
36+
37+
margin-bottom: 10px;
38+
39+
background-color: #ecf0f1;
40+
border-bottom: 3px solid #bdc3c7;
41+
42+
line-height: 50px;
43+
}
44+
45+
a {
46+
display: block;
47+
width: 100%;
48+
height: 100%;
49+
50+
font-size: 30px;
51+
text-decoration: none;
52+
color: #2c3e50;
53+
}
54+
55+
.description {
56+
font-size: 15px;
57+
color: #34495e;
58+
}
59+
</style>
60+
</head>
61+
62+
<body>
63+
<div id="content">
64+
<h1>Homie for ESP8266 docs</h1>
65+
66+
<h2>Configurators</h2>
67+
68+
$configurators_html
69+
70+
<h2>Documentation</h2>
71+
72+
$documentation_html
73+
</div>
74+
</body>
75+
</html>

.circleci/assets/generate_docs.py

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
import json
5+
import urllib
6+
import urllib2
7+
import tempfile
8+
import zipfile
9+
import glob
10+
import subprocess
11+
import getopt
12+
import sys
13+
import shutil
14+
import os
15+
import string
16+
17+
FIRST_RELEASE_ID=3084382
18+
DOCS_PATH = 'docs'
19+
DOCS_BRANCHES = [
20+
{ 'tag': 'develop', 'description': 'develop branch (development)', 'path': 'develop' },
21+
{ 'tag': 'master', 'description': 'master branch (stable)', 'path': 'stable' }
22+
]
23+
CONFIGURATORS_PATH = 'configurators'
24+
CONFIGURATORS_VERSIONS = [
25+
{ 'title': 'v2', 'description': 'For Homie v2.x.x', 'path': 'v2', 'url': 'https://github.com/marvinroger/homie-esp8266-setup/raw/gh-pages/ui_bundle.html' },
26+
{ 'title': 'v1', 'description': 'For Homie v1.x.x', 'path': 'v1', 'file': '/configurator_v1.html' }
27+
]
28+
29+
current_dir = os.path.dirname(__file__)
30+
output_dir = getopt.getopt(sys.argv[1:], 'o:')[0][0][1]
31+
github_releases = json.load(urllib2.urlopen('https://api.github.com/repos/marvinroger/homie-esp8266/releases'))
32+
33+
def generate_docs(data):
34+
print('Generating docs for ' + data['tag'] + ' (' + data['description'] + ') at /' + data['path'] + '...')
35+
zip_url = 'https://github.com/marvinroger/homie-esp8266/archive/' + data['tag'] + '.zip'
36+
zip_path = tempfile.mkstemp()[1]
37+
urllib.urlretrieve(zip_url, zip_path)
38+
39+
zip_file = zipfile.ZipFile(zip_path, 'r')
40+
unzip_path = tempfile.mkdtemp()
41+
zip_file.extractall(unzip_path)
42+
src_path = glob.glob(unzip_path + '/*')[0]
43+
44+
if not os.path.isfile(src_path + '/mkdocs.yml'): shutil.copy(current_dir + '/mkdocs.default.yml', src_path + '/mkdocs.yml')
45+
46+
subprocess.call(['mkdocs', 'build'], cwd=src_path)
47+
shutil.copytree(src_path + '/site', output_dir + '/' + DOCS_PATH + '/' + data['path'])
48+
print('Done.')
49+
50+
def generate_configurators(data):
51+
print('Generating configurator for ' + data['title'] + ' (' + data['description'] + ') at /' + data['path'] + '...')
52+
file_path = None
53+
if 'file' in data:
54+
file_path = current_dir + data['file']
55+
else: # url
56+
file_path = tempfile.mkstemp()[1]
57+
urllib.urlretrieve(data['url'], file_path)
58+
59+
prefix_output = output_dir + '/' + CONFIGURATORS_PATH + '/' + data['path']
60+
try:
61+
os.makedirs(prefix_output)
62+
except:
63+
pass
64+
65+
shutil.copy(file_path, prefix_output + '/index.html')
66+
67+
print('Done.')
68+
69+
shutil.rmtree(output_dir, ignore_errors=True)
70+
71+
# Generate docs
72+
73+
generated_docs = []
74+
75+
# Generate docs for branches
76+
77+
for branch in DOCS_BRANCHES:
78+
generated_docs.append(branch)
79+
generate_docs(branch)
80+
81+
# Generate docs for releases
82+
83+
for release in github_releases:
84+
if (release['id'] < FIRST_RELEASE_ID): continue
85+
86+
tag_name = release['tag_name']
87+
version = tag_name[1:]
88+
description = 'release ' + version
89+
90+
data = {
91+
'tag': tag_name,
92+
'description': description,
93+
'path': version
94+
}
95+
96+
generated_docs.append(data)
97+
generate_docs(data)
98+
99+
# Generate documentation html
100+
101+
documentation_html = '<ul>'
102+
for documentation_data in generated_docs:
103+
documentation_html += '<li><a href="' + DOCS_PATH + '/' + documentation_data['path'] + '"># ' + documentation_data['tag'] + ' <span class="description">' + documentation_data['description'] + '</span></a></li>'
104+
documentation_html += '</ul>'
105+
106+
# Generate configurators
107+
108+
generated_configurators = []
109+
110+
for version in CONFIGURATORS_VERSIONS:
111+
generated_configurators.append(version)
112+
generate_configurators(version)
113+
114+
# Generate configurators html
115+
116+
configurators_html = '<ul>'
117+
for configurator_data in generated_configurators:
118+
configurators_html += '<li><a href="' + CONFIGURATORS_PATH + '/' + configurator_data['path'] + '"># ' + configurator_data['title'] + ' <span class="description">' + configurator_data['description'] + '</span></a></li>'
119+
configurators_html += '</ul>'
120+
121+
# Generate index
122+
123+
docs_index_template_file = open(current_dir + '/docs_index_template.html')
124+
docs_index_template_html = docs_index_template_file.read()
125+
docs_index_template = string.Template(docs_index_template_html)
126+
docs_index = docs_index_template.substitute(documentation_html=documentation_html, configurators_html=configurators_html)
127+
128+
docs_index_file = open(output_dir + '/index.html', 'w')
129+
docs_index_file.write(docs_index)
130+
docs_index_file.close()

.circleci/assets/id_rsa.enc

3.19 KB
Binary file not shown.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
site_name: Homie for ESP8266
2+
repo_name: 'marvinroger/homie-esp8266'
3+
repo_url: 'https://github.com/marvinroger/homie-esp8266'
4+
5+
theme:
6+
name: material
7+
palette:
8+
primary: red
9+
accent: red
10+
11+
markdown_extensions:
12+
- meta
13+
- footnotes
14+
- codehilite
15+
- admonition
16+
- toc(permalink=true)
17+
- pymdownx.arithmatex
18+
- pymdownx.betterem(smart_enable=all)
19+
- pymdownx.caret
20+
- pymdownx.critic
21+
- pymdownx.emoji:
22+
emoji_generator: !!python/name:pymdownx.emoji.to_svg
23+
- pymdownx.inlinehilite
24+
- pymdownx.magiclink
25+
- pymdownx.mark
26+
- pymdownx.smartsymbols
27+
- pymdownx.superfences
28+
- pymdownx.tasklist(custom_checkbox=true)
29+
- pymdownx.tilde

.circleci/config.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/code
5+
docker:
6+
- image: circleci/python:2.7
7+
steps:
8+
- checkout
9+
- run:
10+
name: install PlatformIO
11+
command: sudo pip install -U https://github.com/platformio/platformio-core/archive/develop.zip
12+
- run:
13+
name: install current code as a PlatformIO library with all dependencies
14+
command: platformio lib -g install file://.
15+
- run:
16+
name: install staging version of Arduino Core for ESP8266
17+
command: platformio platform install https://github.com/platformio/platform-espressif8266.git#feature/stage
18+
- run:
19+
name: install exemples dependencies
20+
command: platformio lib -g install [email protected] [email protected]
21+
- run: platformio ci ./examples/CustomSettings --board=esp01 --board=nodemcuv2
22+
- run: platformio ci ./examples/DoorSensor --board=esp01 --board=nodemcuv2
23+
- run: platformio ci ./examples/HookToEvents --board=esp01 --board=nodemcuv2
24+
- run: platformio ci ./examples/IteadSonoff --board=esp01 --board=nodemcuv2
25+
- run: platformio ci ./examples/LightOnOff --board=esp01 --board=nodemcuv2
26+
- run: platformio ci ./examples/TemperatureSensor --board=esp01 --board=nodemcuv2
27+
- run: platformio ci ./examples/LedStrip --board=esp01 --board=nodemcuv2
28+
- run: platformio ci ./examples/Broadcast --board=esp01 --board=nodemcuv2
29+
- run: platformio ci ./examples/GlobalInputHandler --board=esp01 --board=nodemcuv2
30+
- run: platformio ci ./examples/SonoffDualShutters --board=esp01 --board=nodemcuv2
31+
32+
lint:
33+
working_directory: ~/code
34+
docker:
35+
- image: circleci/python:2.7
36+
steps:
37+
- checkout
38+
- run:
39+
name: install cpplint
40+
command: sudo pip install cpplint
41+
- run: make cpplint
42+
43+
generate_docs:
44+
working_directory: ~/code
45+
docker:
46+
- image: circleci/python:2.7
47+
steps:
48+
- checkout
49+
- run:
50+
name: install dependencies
51+
command: sudo pip install mkdocs==0.17.2 mkdocs-material==2.2.0 pygments==2.2.0 pymdown-extensions==4.5.1
52+
- run:
53+
name: generate and publish docs
54+
command: |
55+
if [ -z ${PRIVATE_KEY_ENCRYPT_KEY+x} ]
56+
then
57+
echo "Fork detected. Ignoring..."
58+
exit 0
59+
fi
60+
61+
openssl aes-256-cbc -d -in ./.circleci/assets/id_rsa.enc -k "${PRIVATE_KEY_ENCRYPT_KEY}" >> /tmp/deploy_rsa
62+
eval "$(ssh-agent -s)"
63+
chmod 600 /tmp/deploy_rsa
64+
ssh-add /tmp/deploy_rsa
65+
66+
chmod +x ./.circleci/assets/generate_docs.py
67+
./.circleci/assets/generate_docs.py -o /tmp/site
68+
69+
# make sure we ignore the gh-pages branch
70+
mkdir /tmp/site/.circleci
71+
cp ./.circleci/assets/circleci.ignore.yml /tmp/site/.circleci/config.yml
72+
73+
pushd /tmp/site
74+
git init
75+
git config --global user.name "circleci"
76+
git config --global user.email "[email protected]"
77+
git remote add origin [email protected]:marvinroger/homie-esp8266.git
78+
git add .
79+
git commit -m ":package: Result of CircleCI build ${CIRCLE_BUILD_URL}"
80+
git push -f origin master:gh-pages
81+
popd
82+
83+
workflows:
84+
version: 2
85+
lint_build_generatedocs:
86+
jobs:
87+
- lint:
88+
filters:
89+
branches:
90+
ignore:
91+
- gh-pages
92+
- build:
93+
filters:
94+
branches:
95+
ignore:
96+
- gh-pages
97+
- generate_docs:
98+
filters:
99+
branches:
100+
ignore:
101+
- gh-pages

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
trim_trailing_whitespace = true
10+
11+
[keywords.txt]
12+
indent_style = tab

.github/ISSUE_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The issue tracker is a great place to ask for enhancements and to report bugs.
2+
If you have some questions or if you need help, some people might help you on the [Gitter room](https://gitter.im/homie-iot/ESP8266).
3+
4+
Before submitting your issue, make sure:
5+
6+
- [ ] You've read the documentation for *your* release (in the `docs/` folder or at http://marvinroger.github.io/homie-esp8266/) which contains some answsers to the most common problems (notably the `Limitations and know issues` and `Troubleshooting` pages)
7+
- [ ] You're using the examples bundled in *your* release, which are in the `examples/` folder of the `.zip` of the release you're using. Examples might not be backward-compatible
8+
9+
Thanks!

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
/config.json
1+
# Output of mkdocs
2+
/site/
3+
4+
/config.json
5+
*.filters
6+
*.vcxitems

0 commit comments

Comments
 (0)