Last active
October 2, 2023 15:18
-
-
Save anttikuuskoski/dd71253aabf9334e9f97b40d55cd1bfc to your computer and use it in GitHub Desktop.
Object.create works when used to replace a subobject on fw 0.14.4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reportConfigError(res, ec, em) { | |
if(ec) | |
console.log("Config update error", ec, em); | |
} | |
let bluConfig = Shelly.getComponentConfig("plugs_ui"); | |
let on = Object.create(bluConfig.leds.colors["switch:0"].on); | |
on.rgb = [50, 0, 50]; | |
bluConfig.leds.colors["switch:0"].on = on; | |
Shelly.call( "PLUGS_UI.SetConfig", { config: bluConfig}, reportConfigError ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment