|  Developer
Updated on November 18, 2021

Updaters

modify_scenes()

  • Modify existing scenes. (only for migration)
Edit
Edit
  • modify_commands (array of tables), block_ids (array of strings) (optional)
Edit
Edit
fields type description
command string command name
to_replace string token to replace
replace_by string token should be replaced by this token
Edit
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
Edit
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.
Edit
  • return: none.
Edit
				
					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 )