renamed scene to states
This commit is contained in:
25
README.md
25
README.md
@@ -35,12 +35,23 @@ Activates the room if the door opens when everything in the room is off.
|
|||||||
|----------|----------------------------------------------|
|
|----------|----------------------------------------------|
|
||||||
| `entity` | Main entity for the room |
|
| `entity` | Main entity for the room |
|
||||||
| `sensor` | `binary_sensor` (motion) sensor for the room |
|
| `sensor` | `binary_sensor` (motion) sensor for the room |
|
||||||
| `scene` | List of states and times for the room. |
|
| `states` | List of states and times for the room. |
|
||||||
| `sleep` | [input_boolean] of the sleep mode variable |
|
|
||||||
|
|
||||||
|
#### Optional
|
||||||
|
|
||||||
|
| Key | Behavior |
|
||||||
|
|----------------|-----------------------------------------------------------------------------------------|
|
||||||
|
| `off_duration` | Default time for the motion sensor to be clear before deactivating the room. `HH:MM:SS` |
|
||||||
|
| `button` | ID of the button to control the room |
|
||||||
|
| `door` | `binary_sensor` (door) sensor for the room |
|
||||||
|
| `sleep` | [input_boolean] of the sleep mode variable |
|
||||||
|
|
||||||
[input_boolean]: https://www.home-assistant.io/integrations/input_boolean/
|
[input_boolean]: https://www.home-assistant.io/integrations/input_boolean/
|
||||||
|
|
||||||
Example state for `scene` key
|
### Scene Definition
|
||||||
|
|
||||||
|
Example state for `states` key
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- time: 22:00:00
|
- time: 22:00:00
|
||||||
@@ -52,14 +63,6 @@ Example state for `scene` key
|
|||||||
brightness_pct: 10
|
brightness_pct: 10
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Optional
|
|
||||||
|
|
||||||
| Key | Behavior |
|
|
||||||
|----------------|-----------------------------------------------------------------------------------------|
|
|
||||||
| `off_duration` | Default time for the motion sensor to be clear before deactivating the room. `HH:MM:SS` |
|
|
||||||
| `button` | ID of the button to control the room |
|
|
||||||
| `door` | `binary_sensor` (door) sensor for the room |
|
|
||||||
|
|
||||||
Sample Button Event Data
|
Sample Button Event Data
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class RoomController(Hass):
|
|||||||
|
|
||||||
def parse_states(self):
|
def parse_states(self):
|
||||||
def gen():
|
def gen():
|
||||||
for state in deepcopy(self.args['scene']):
|
for state in deepcopy(self.args['states']):
|
||||||
if (time := state.get('time')):
|
if (time := state.get('time')):
|
||||||
state['time'] = self.parse_time(time)
|
state['time'] = self.parse_time(time)
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ class RoomController(Hass):
|
|||||||
"""Returns a list of all the entities involved in any of the states
|
"""Returns a list of all the entities involved in any of the states
|
||||||
"""
|
"""
|
||||||
def gen():
|
def gen():
|
||||||
for settings in deepcopy(self.args['scene']):
|
for settings in deepcopy(self.args['states']):
|
||||||
# dt = self.parse_time(settings.pop('time'))
|
# dt = self.parse_time(settings.pop('time'))
|
||||||
if (scene := settings.get('scene')):
|
if (scene := settings.get('scene')):
|
||||||
if isinstance(scene, str):
|
if isinstance(scene, str):
|
||||||
|
|||||||
Reference in New Issue
Block a user