Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelVeeamer committed Mar 27, 2024
1 parent 43a1932 commit c1fb712
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 5 deletions.
18 changes: 18 additions & 0 deletions Docs/Advanced/custom-automation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
How to Build and Use Custom Automation
=======================================

NetEntityAutomation library provides a set of interfaces that can be used for creating custom automation.
Such automations can be packed to the NuGet package.
This is the way how users can share their automation with others.

## Automation Interfaces

There are several abstract classes that need to be implemented to create a custom automation:

- `AutomationBase` - the base class for all automations.
- `AutomationBase<TEntity>` - the base class for automations that work with specific entity type.
This class is used for the most common cases.
- `AutomationBase<TEntity, TFsm>` - the base class for automations that work with specific entity type and uses Finite State Machine (FSM).
FSM in most cases is used for storing the current state of the automation to restore it after application restart (e.g. after system restart or crash).

An example of usage of these classes can be found in the `NetEntityAutomation.Core.Automations` project (built-in automations) or in [example](https://github.com/x00Pavel/NetEntityAutomation-Custo-Automatation) repo with the entire NetDaemon application and custom automation.
17 changes: 16 additions & 1 deletion Docs/Advanced/room-service.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Room Controls

The NetEntityAutomation creates several services for controlling automation in individual rooms.
The NetEntityAutomation creates several services for controlling automation in individual rooms.

> Currently, only toggle of all automations in the room is supported.
The name of such service is in the format `netdaemon.toggle_<room_name>_service`
where `<room_name>` is the name of the room in lower case with spaces replace by underscores.
To call such service in Home Assistant, use the following service call:

```yaml
service: netdaemon.toggle_living_room_service
data: {}
```
> As only toggle action is supported, there is no need to specify any data.
> This approach is used to simplify the service call.
> In the future, more actions with data can be added to the service.
2 changes: 1 addition & 1 deletion Docs/how-to-use.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HOWTO Use NetEntityAutomation Library
# How To Use NetEntityAutomation Library

NetEntityAutomation library provides a set of ready-to-use automation scenarios.
It is designed to be used with [NetDaemon](https://netdaemon.xyz/) framework.
Expand Down
8 changes: 8 additions & 0 deletions Docs/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
items:
- name: How To Use
href: how-to-use.md
- name: Advanced
items:
- href: Advanced/room-service.md
- name: Custom Automation
href: Advanced/custom-automation.md
6 changes: 3 additions & 3 deletions toc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- name: Home
href: index.md
- name: Getting Started
href: Docs/how-to-use.md
href: ./index.md
- name: User Manual
href: Docs/
- name: API
href: api/

0 comments on commit c1fb712

Please sign in to comment.