Skip to content

Commit

Permalink
Devel (#110)
Browse files Browse the repository at this point in the history
* start v45 branch

* #36 add config struct (#83)

* Split stastics

* ADD: autodimmer implementation

* Add autodimmer enable/disable log

* Add config set API message

* change AutoDimWait 30->10

* checkpoint commit

* intermediate commit

* fix setup mode wifi

* last 1 error

* compile passed!

* fix config read bug

* startup success

* move SimpleMap to include

* add setup post BUGCHECK

* debuglog to category log

* delete comment

* [BUG] Waning is override by Caution (#88)

Fixes #85

* yakumo-saki/issue89 (#90)

* [Enhance] Config Metadata
Fixes #89

* Add comment

* Prepare for add validation

* [Enhance] Config Metadata
Fixes #89

* [BUG] set api not response invalid key (#94)

Fixes #91

* [Enhance] value error handling on Config Set API
Fixes #93

* ignore embed dir (generated)

* add embed to gitignore

* fix gitignore

* CSS: setup_err background color

* [Enhance] Use sendContent in HTTP
Fixes #96

* Update documents for v45

* Update docs

* fix compile error

* fix wrong diff value on boot

* Prepare for webconfig in normal mode

* test
  • Loading branch information
yakumo-saki authored Dec 12, 2022
1 parent b822947 commit 5fd787a
Show file tree
Hide file tree
Showing 30 changed files with 532 additions and 70 deletions.
26 changes: 23 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
[*.cpp,*.h, *.hpp]
indent_size = 2;
indent_style = space
root = true

charset = utf-8

[*.{cpp,h,hpp}]
indent_size = 2
indent_style = space

[*.{py}]
indent_size = 4
indent_style = space

[*.{htm,html,css}]
indent_size = 4
indent_style = space

[*.{yml,yaml}]
indent_size = 2
indent_style = space

[*.{ini}]
indent_size = 4
indent_style = tab
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
.vscode/launch.json
.vscode/ipch
.vscode

# embed is auto generated directory.
include/embed/**

# temporary place files when develop web ui
embed/static/**

_release
_release/**

EnvBoyX.zip
EnvBoyX.tar.gz
EnvBoyX-*.tar.gz
17 changes: 10 additions & 7 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@
"cinttypes": "cpp",
"typeinfo": "cpp",
"atomic": "cpp"
}
},
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ EnvBoyX has HTTP web API.
* WeMos D1mini
* NodeMCU V3

## build note

* Use python script to store some html, css
* Script is stored in build_script
* Script is automatically executed by platformio
* See platform.io [env] extra_script for details.

## Version History

see [Version History](docs/history.md) for details.
28 changes: 28 additions & 0 deletions _how-to-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# how to develop web ui

## copy files except config.html to static/

```
cd embed
rsync -v --exclude=config.html ./* static
```

## run python http.server or some simple web server on embed

```
cd embed
python -m http.server
```

## Access web via web browser

Use firefox or chrome newer version.

# after development

Dont forget to write back all files in static/ to embed.

```
cd embed/static
cp -v ./* ../
```
10 changes: 10 additions & 0 deletions build_script/create_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ def create_name_from_filename(filename):
template = readall(TEMPLATE_FILE)

for file in pathlib.Path(EMBED_DIR).iterdir():
#print(file.name)
if file.is_dir():
print(f"ignored sub directory {file.name}")
continue

if file.name.endswith(".md") or file.name.endswith(".sh"):
print(f"ignored markdown file {file.name}")
continue

# start generating source
output = template
data = readall(file)

Expand Down
3 changes: 1 addition & 2 deletions build_script/template.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <Arduino.h>

static const char $$REPLACE_NAME$$[] PROGMEM = R"=====(
$$REPLACE_CONTENT$$
static const char $$REPLACE_NAME$$[] PROGMEM = R"=====($$REPLACE_CONTENT$$
)=====";
7 changes: 7 additions & 0 deletions devel_web.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -eu

WORKDIR=$(dirname $0)

cd $WORKDIR/embed

python -m http.server 8080
7 changes: 7 additions & 0 deletions devel_writeback.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

WORKDIR=$(dirname $0)

cd $WORKDIR/embed

watch -n 15 cp -v "./static/*" .
Loading

0 comments on commit 5fd787a

Please sign in to comment.