Skip to content

Commit

Permalink
Multiple tasks to run simultaneously in automation
Browse files Browse the repository at this point in the history
Add low and high threshold for weather alerts
Update README.md and bump sub-version
  • Loading branch information
dormant-user committed Jul 19, 2023
1 parent f355990 commit ee5c13a
Show file tree
Hide file tree
Showing 15 changed files with 179 additions and 122 deletions.
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,10 @@ Environment variables are loaded from a `.env` file and validated using `pydanti
- **SYNC_EVENTS** - Interval in seconds to generate ``events`` information using `calendar` or `outlook` application.

**Scheduled**
- **WEATHER_ALERT** - Time (in 24h `HH:MM` format) when the weather alert should be fired - Example: `09:00`
> Alerts in SMS and Email if temperature is higher than 100 or lower than 36 or severe weather warnings.<br>
- **WEATHER_ALERT** - Time (in 12h `%I:%M %p` format) when the weather alert should be fired - Example: `09:00 AM`
- **WEATHER_ALERT_MIN** - Degrees below which alert has to be fired.
- **WEATHER_ALERT_MAX** - Degrees above which alert has to be fired.
> Alerts in SMS and Email if temperature is higher than `WEATHER_ALERT_MAX` or lower than `WEATHER_ALERT_MIN` or severe weather warnings.<br>
> This feature can also be enabled from `automation.yaml` by using the keyword `weather` in phrase for the `task`
- **CRONTAB** - Runs external tasks using cron expressions. Needs to be stored as env var.
<details>
Expand Down Expand Up @@ -424,21 +426,23 @@ The YAML file should be a dictionary within a dictionary that looks like the bel
```yaml
06:00 AM:
day: weekday # Runs only between Monday and Friday
task: set my bedroom lights to 50%
- task: set my bedroom lights to 50%
day: weekday # Runs only between Monday and Friday
06:30 AM:
day: # Runs only on Monday, Wednesday and Friday
- Monday
- wednesday
- FRIDAY
task: set my bedroom lights to 100%
- task: set my bedroom lights to 100%
day: # Runs only on Monday, Wednesday and Friday
- Monday
- wednesday
- FRIDAY
08:00 AM: # Runs only on Saturday and Sunday
day: weekend
task: set my bedroom lights to 100%
09:00 PM: # Runs daily
- task: set my bedroom lights to 100%
day: weekend
09:00 PM: # Runs daily (can take both list of dict and dict as argument)
task: set my bedroom lights to 5%
12:00 AM: # Even performs tasks that are not supported via voice commands
task: restart all background processes
- task: restart all background processes
- task: turn off all lights
day: weekday
```
</details>
Expand Down
32 changes: 19 additions & 13 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,13 @@ <h2>Features<a class="headerlink" href="#features" title="Permalink to this head
</ul>
<p><strong>Scheduled</strong></p>
<ul>
<li><p><strong>WEATHER_ALERT</strong> - Time (in 24h <code class="docutils literal notranslate"><span class="pre">HH:MM</span></code> format) when the weather alert should be fired - Example: <code class="docutils literal notranslate"><span class="pre">09:00</span></code></p>
<li><p><strong>WEATHER_ALERT</strong> - Time (in 12h <code class="docutils literal notranslate"><span class="pre">%I:%M</span> <span class="pre">%p</span></code> format) when the weather alert should be fired - Example: <code class="docutils literal notranslate"><span class="pre">09:00</span> <span class="pre">AM</span></code></p>
<ul class="simple">
<li><p><strong>WEATHER_ALERT_MIN</strong> - Degrees below which alert has to be fired.</p></li>
<li><p><strong>WEATHER_ALERT_MAX</strong> - Degrees above which alert has to be fired.</p></li>
</ul>
<blockquote>
<div><p>Alerts in SMS and Email if temperature is higher than 100 or lower than 36 or severe weather warnings.<br>
<div><p>Alerts in SMS and Email if temperature is higher than <code class="docutils literal notranslate"><span class="pre">WEATHER_ALERT_MAX</span></code> or lower than <code class="docutils literal notranslate"><span class="pre">WEATHER_ALERT_MIN</span></code> or severe weather warnings.<br>
This feature can also be enabled from <code class="docutils literal notranslate"><span class="pre">automation.yaml</span></code> by using the keyword <code class="docutils literal notranslate"><span class="pre">weather</span></code> in phrase for the <code class="docutils literal notranslate"><span class="pre">task</span></code></p>
</div></blockquote>
</li>
Expand Down Expand Up @@ -486,21 +490,23 @@ <h2>Automation [Optional]<a class="headerlink" href="#automation-optional" title
Date format should match exactly as described below.</p>
</div></blockquote>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">06:00 AM</span><span class="p">:</span>
<span class="w"> </span><span class="nt">day</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">weekday</span><span class="w"> </span><span class="c1"># Runs only between Monday and Friday</span>
<span class="w"> </span><span class="nt">task</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">set my bedroom lights to 50%</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">task</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">set my bedroom lights to 50%</span>
<span class="w"> </span><span class="nt">day</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">weekday</span><span class="w"> </span><span class="c1"># Runs only between Monday and Friday</span>
<span class="nt">06:30 AM</span><span class="p">:</span>
<span class="w"> </span><span class="nt">day</span><span class="p">:</span><span class="w"> </span><span class="c1"># Runs only on Monday, Wednesday and Friday</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Monday</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">wednesday</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">FRIDAY</span>
<span class="w"> </span><span class="nt">task</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">set my bedroom lights to 100%</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">task</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">set my bedroom lights to 100%</span>
<span class="w"> </span><span class="nt">day</span><span class="p">:</span><span class="w"> </span><span class="c1"># Runs only on Monday, Wednesday and Friday</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Monday</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">wednesday</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">FRIDAY</span>
<span class="nt">08:00 AM</span><span class="p">:</span><span class="w"> </span><span class="c1"># Runs only on Saturday and Sunday</span>
<span class="w"> </span><span class="nt">day</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">weekend</span>
<span class="w"> </span><span class="nt">task</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">set my bedroom lights to 100%</span>
<span class="nt">09:00 PM</span><span class="p">:</span><span class="w"> </span><span class="c1"># Runs daily</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">task</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">set my bedroom lights to 100%</span>
<span class="w"> </span><span class="nt">day</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">weekend</span>
<span class="nt">09:00 PM</span><span class="p">:</span><span class="w"> </span><span class="c1"># Runs daily (can take both list of dict and dict as argument)</span>
<span class="w"> </span><span class="nt">task</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">set my bedroom lights to 5%</span>
<span class="nt">12:00 AM</span><span class="p">:</span><span class="w"> </span><span class="c1"># Even performs tasks that are not supported via voice commands</span>
<span class="w"> </span><span class="nt">task</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">restart all background processes</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">task</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">restart all background processes</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">task</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">turn off all lights</span>
<span class="w"> </span><span class="nt">day</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">weekday</span>
</pre></div>
</div>
</details></section>
Expand Down
30 changes: 17 additions & 13 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,10 @@ Environment variables are loaded from a `.env` file and validated using `pydanti
- **SYNC_EVENTS** - Interval in seconds to generate ``events`` information using `calendar` or `outlook` application.

**Scheduled**
- **WEATHER_ALERT** - Time (in 24h `HH:MM` format) when the weather alert should be fired - Example: `09:00`
> Alerts in SMS and Email if temperature is higher than 100 or lower than 36 or severe weather warnings.<br>
- **WEATHER_ALERT** - Time (in 12h `%I:%M %p` format) when the weather alert should be fired - Example: `09:00 AM`
- **WEATHER_ALERT_MIN** - Degrees below which alert has to be fired.
- **WEATHER_ALERT_MAX** - Degrees above which alert has to be fired.
> Alerts in SMS and Email if temperature is higher than `WEATHER_ALERT_MAX` or lower than `WEATHER_ALERT_MIN` or severe weather warnings.<br>
> This feature can also be enabled from `automation.yaml` by using the keyword `weather` in phrase for the `task`
- **CRONTAB** - Runs external tasks using cron expressions. Needs to be stored as env var.
<details>
Expand Down Expand Up @@ -424,21 +426,23 @@ The YAML file should be a dictionary within a dictionary that looks like the bel
```yaml
06:00 AM:
day: weekday # Runs only between Monday and Friday
task: set my bedroom lights to 50%
- task: set my bedroom lights to 50%
day: weekday # Runs only between Monday and Friday
06:30 AM:
day: # Runs only on Monday, Wednesday and Friday
- Monday
- wednesday
- FRIDAY
task: set my bedroom lights to 100%
- task: set my bedroom lights to 100%
day: # Runs only on Monday, Wednesday and Friday
- Monday
- wednesday
- FRIDAY
08:00 AM: # Runs only on Saturday and Sunday
day: weekend
task: set my bedroom lights to 100%
09:00 PM: # Runs daily
- task: set my bedroom lights to 100%
day: weekend
09:00 PM: # Runs daily (can take both list of dict and dict as argument)
task: set my bedroom lights to 5%
12:00 AM: # Even performs tasks that are not supported via voice commands
task: restart all background processes
- task: restart all background processes
- task: turn off all lights
day: weekday
```
</details>
Expand Down
30 changes: 17 additions & 13 deletions docs/_sources/README.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,10 @@ Environment variables are loaded from a `.env` file and validated using `pydanti
- **SYNC_EVENTS** - Interval in seconds to generate ``events`` information using `calendar` or `outlook` application.

**Scheduled**
- **WEATHER_ALERT** - Time (in 24h `HH:MM` format) when the weather alert should be fired - Example: `09:00`
> Alerts in SMS and Email if temperature is higher than 100 or lower than 36 or severe weather warnings.<br>
- **WEATHER_ALERT** - Time (in 12h `%I:%M %p` format) when the weather alert should be fired - Example: `09:00 AM`
- **WEATHER_ALERT_MIN** - Degrees below which alert has to be fired.
- **WEATHER_ALERT_MAX** - Degrees above which alert has to be fired.
> Alerts in SMS and Email if temperature is higher than `WEATHER_ALERT_MAX` or lower than `WEATHER_ALERT_MIN` or severe weather warnings.<br>
> This feature can also be enabled from `automation.yaml` by using the keyword `weather` in phrase for the `task`
- **CRONTAB** - Runs external tasks using cron expressions. Needs to be stored as env var.
<details>
Expand Down Expand Up @@ -424,21 +426,23 @@ The YAML file should be a dictionary within a dictionary that looks like the bel

```yaml
06:00 AM:
day: weekday # Runs only between Monday and Friday
task: set my bedroom lights to 50%
- task: set my bedroom lights to 50%
day: weekday # Runs only between Monday and Friday
06:30 AM:
day: # Runs only on Monday, Wednesday and Friday
- Monday
- wednesday
- FRIDAY
task: set my bedroom lights to 100%
- task: set my bedroom lights to 100%
day: # Runs only on Monday, Wednesday and Friday
- Monday
- wednesday
- FRIDAY
08:00 AM: # Runs only on Saturday and Sunday
day: weekend
task: set my bedroom lights to 100%
09:00 PM: # Runs daily
- task: set my bedroom lights to 100%
day: weekend
09:00 PM: # Runs daily (can take both list of dict and dict as argument)
task: set my bedroom lights to 5%
12:00 AM: # Even performs tasks that are not supported via voice commands
task: restart all background processes
- task: restart all background processes
- task: turn off all lights
day: weekday
```
</details>

Expand Down
8 changes: 6 additions & 2 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -3080,17 +3080,21 @@ <h2 id="W">W</h2>
<li><a href="index.html#jarvis.executors.weather.weather">weather() (in module jarvis.executors.weather)</a>
</li>
<li><a href="index.html#jarvis.modules.models.classes.EnvConfig.weather_alert">weather_alert (jarvis.modules.models.classes.EnvConfig attribute)</a>
</li>
<li><a href="index.html#jarvis.modules.models.classes.EnvConfig.weather_alert_max">weather_alert_max (jarvis.modules.models.classes.EnvConfig attribute)</a>
</li>
<li><a href="index.html#jarvis.modules.models.classes.EnvConfig.weather_alert_min">weather_alert_min (jarvis.modules.models.classes.EnvConfig attribute)</a>
</li>
<li><a href="index.html#jarvis.modules.models.classes.EnvConfig.weather_api">weather_api (jarvis.modules.models.classes.EnvConfig attribute)</a>
</li>
<li><a href="index.html#jarvis.modules.models.classes.EnvConfig.website">website (jarvis.modules.models.classes.EnvConfig attribute)</a>
</li>
<li><a href="index.html#jarvis.api.routers.surveillance.websocket_endpoint">websocket_endpoint() (in module jarvis.api.routers.surveillance)</a>
</li>
<li><a href="index.html#jarvis.executors.static_responses.what">what() (in module jarvis.executors.static_responses)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#jarvis.executors.static_responses.what">what() (in module jarvis.executors.static_responses)</a>
</li>
<li><a href="index.html#jarvis.executors.static_responses.whats_up">whats_up() (in module jarvis.executors.static_responses)</a>
</li>
<li><a href="index.html#jarvis.executors.static_responses.who">who() (in module jarvis.executors.static_responses)</a>
Expand Down
Loading

0 comments on commit ee5c13a

Please sign in to comment.