lib.scene

This file implements scenes in SmartHomeNG

class lib.scene.Scenes(smarthome)[Quellcode]

Bases: object

This class loads all scene definitions from /scenes folder and adds the necessary triggers for the scenes to function.

Note

The scene definitions are stored in /scenes files with the extension .conf but don’t follow the file format for conf-files of smarthome.py!

Parameter

smarthome (object) – Main SmartHomeNG object

static get_instance()[Quellcode]

Returns the instance of the Scenes class, to be used to access the scene-api

Use it the following way to access the api:

from lib.scene import Scenes
scenes = Scenes.get_instance()

# to access a method (eg. xxx()):
scenes.xxx()
Rückgabe

scenes instance

Rückgabetyp

object of None

get_loaded_scenes()[Quellcode]

Returns a list with the names of all scenes that are currently loaded

Rückgabe

list of scene names

Rückgabetyp

list

get_scene_action_name(scenename, action)[Quellcode]

Returns the name of a scene-action

get_scene_actions(name)[Quellcode]

Returns a list with the the defined actions for a scene

Rückgabe

list of scene values

Rückgabetyp

list

reload_scenes()[Quellcode]

Reload defined scenes with learned values from ../scene directory

Rückgabe

return_scene_value_actions(name, state)[Quellcode]

Returns a list with the the defined actions for state of a scene

Rückgabe

list of value actions (destination item name, value to set)

Rückgabetyp

list