Scenes module

Scenes module description

Scenes module provides an access to a existing scenes.


Scenes module API ( require "scenes" )

Updaters


modify_scenes()

Modify existing scenes. (only for migration)

call: scenes.modify_scenes()

params: modify_commands (array of tables), block_ids (array of strings) (optional)

replace_token command:

fields type description
command string command name
to_replace string token to replace
replace_by string token should be replaced by this token

replace_option_label command:

fields type description
command string command name
language_tag string language text with this tag should be replaced
replace_by_text string language text should be replaced by this text

block_ids:

fields type description
block_ids stringArray [opt] this command should be affected to scenes with these blocks only. If this field is absent then command is affected all scenes.

return: none.

example:

    require "scenes"

    local replace_token = { 
        command = "replace_token",
        to_replace = "rapid_temperature_fail",
        replace_by = "rapid_temperature_fall"
    }

    local replace_option_label = { 
        command = "replace_option_label",
        language_tag = "rapid_temperature_fail",
        replace_by_text = "Rapid temperature fall"
    }

    local block_ids = { "0001-00000022", "0001-00000021" }

    scenes.modify_scenes( { replace_token, replace_option_label } )
    scenes.modify_scenes( { replace_token, replace_option_label }, block_ids )