Skip to content

Commit

Permalink
formatting, fix spelling, add contact form
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Sep 16, 2024
1 parent 0986cfd commit ff7c98f
Show file tree
Hide file tree
Showing 16 changed files with 6,512 additions and 5,331 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Easiest way is to run pip as a module (<https://realpython.com/what-is-pip/#usin
- `pip install -r requirements.txt` to refresh latest libs
- `mkdocs serve` to build the documentation
- <http://127.0.0.1:8000/docs>
- TIP: comment out the `git-committers` in `mkdocs.yml` to speed up the build and prevent exceeding the GitHub API calls, but remember to uncomment it before committing
- TIP: comment out the `git-committers` and `git-revision-date-localized` sections in `mkdocs.yml` to speed up the build and prevent exceeding the GitHub API calls, but remember to uncomment it before committing

## Deploying manually

Expand Down
21 changes: 21 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"dictionaryDefinitions": [
{
"name": "project-words",
"path": "./project-words.txt",
"addWords": true
}
],
"dictionaries": ["project-words"],
"ignorePaths": [
"**/_media/**",
"**/*.yml",
"**/*.txt",
"**/*.css",
"**/venv/**",
"**/*.csv",
"/project-words.txt"
]
}
6 changes: 4 additions & 2 deletions docs/Adding-Languages.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### How to add language XY to the WebUI:
### How to add language XY to the WebUI

- Download the SVG flag from [here](https://gitlab.com/catamphetamine/country-flag-icons/-/tree/master/3x2) and place in `interface/src/i18n`
- Create the folder XY in `interface/src/i18n`
Expand Down Expand Up @@ -29,12 +29,14 @@ import { ReactComponent as XYflag } from './i18n/XY.svg';

- Navigate to the `interface` folder and type `npm run standalone` or `npm run typesafe-i18n` and test the WebUI

### How to add language XY to device entities:
### How to add language XY to device entities

- Edit `interface/src/project/SettingsApplication.tsx` and insert in selection box (~ line 345):

```ts
<MenuItem value="xy">NewLanguage (XY)</MenuItem>
```

- Edit `src/system.cpp` line 45 and append `EMSESP_LOCALE_XY` to the `languages[]` array
- Edit `src/local_translations.h` and append the defines by adding
`#define EMSESP_LOCALE_XY "xy"`
Expand Down
2 changes: 1 addition & 1 deletion docs/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This will open a browser window with URL `localhost:3000`.

The mock data used is all hardcoded in `/mock-api/rest_server.js`.

### Simulating offline, without an ESP32 microncontroller
### Simulating offline, without an ESP32 microcontroller

You can also run EMS-ESP without an ESP32 (which we call 'standalone'). The platformIO environment has two `native` environments that will build emsesp executables to support this for all Linux, Windows and Max OSX.

Expand Down
19 changes: 11 additions & 8 deletions docs/Configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,28 +197,31 @@ Pay attention to the following rules:
### Web Commands

Sending or getting data via web request can be used in a json command:
- GET a value from webserver:

- GET a value from webserver:
`{"url":"http://server.tld/path/file"}`
- GET a json value from webserver and select the key:
- GET a json value from webserver and select the key:
`{"url":"http://server.tld/path/file", "key":"nameofkey"}`
- set a value with POST:
Command: `{"url":"http://server.tld/path/file", "header":{"content-type":"text/plain", "token":"mytoken"}`
Value: the post message, if it is a json the content-type header is set in header, no need to set it.
Command: `{"url":"http://server.tld/path/file", "header":{"content-type":"text/plain", "token":"mytoken"}`
Value: the post message, if it is a json the content-type header is set in header, no need to set it.

Examples:

Examples:
- getting power state of a tasmota plug (exampleIP):
- getting power state of a tasmota plug (exampleIP):
`{"url":"http://192.168.0.100/cm?cmnd=power", "key":"power"} == off`
is identical with
`{"url":"http://192.168.0.100/cm?cmnd=power"} == {"power":"off"}`
- setting a tasmoto plug:
- setting a tasmoto plug:
`{"url":"http://192.168.0.100/cm?cmnd=power%20on"}`

### Notification

With web commands a service like [pushover](https://pushover.net) can be used to send a push-message on events. To send different message create a custom entity in RAM named `message`, or what you like. Create a schedule on change triggering the change of this message and sending the pushover message.

![grafik](https://github.com/user-attachments/assets/570576b5-b382-4ab2-bff3-4468291334a3)

Now you can create other scheduls with the command `custom/message` and individual text as data.
Now you can create other schedules with the command `custom/message` and individual text as data.

## Adding Custom Entities

Expand Down
27 changes: 27 additions & 0 deletions docs/Contact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contact Us

<section>
<div class="md-grid"
style="max-width: 840px; margin-left: 0; display: flex; justify-content: left;">
<form method="post"
action="https://forms.un-static.com/forms/3fbb6601b89b6fc6ccb7b324ef3e65abc9ec6a52"
class="md-grid md-form"
style="display: grid; grid-template-columns: 150px 2fr; gap: 10px; width: 100%;">
<label for="name" class="md-text" style="text-align: left; padding-right: 10px;">Name</label>
<input type="text" id="name" name="name" required class="md-input">

<label for="email" class="md-text" style="text-align: left; padding-right: 10px;">Email</label>
<input type="email" id="email" name="email" required class="md-input">

<label for="subject" class="md-text" style="text-align: left; padding-right: 10px;">Subject</label>
<input type="text" id="subject" name="subject" required class="md-input">

<label for="message" class="md-text" style="text-align: left; padding-right: 10px;">Message</label>
<textarea id="message" name="message" style="height: 200px;" class="md-input"></textarea>

<div></div> <!-- Empty cell for spacing -->
<button type="submit" class="md-button" style="width: fit-content; justify-self: start;">Send</button>
</form>

</div>
</section>
Loading

0 comments on commit ff7c98f

Please sign in to comment.