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
import type { ReactElement, ReactNode } from 'react'; | |
import React, { Children, cloneElement, isValidElement } from 'react'; | |
import { render } from '@testing-library/react'; | |
function setFakeReactDispatcher<T>(action: () => T): T { | |
/** | |
* We use some internals from React to avoid a lot of warnings in our tests when faking | |
* to render server components. If the structure of React changes, this function should still work, | |
* but the tests will again print warnings. | |
* |
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
import SwiftUI | |
import UIKit | |
struct ContentView: View { | |
@State private var isLocked = false | |
@State private var isSheetVisible = false | |
var body: some View { | |
LockableView(isLocked: isLocked) { |
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
/*global Shelly, MQTT */ | |
/** | |
* Variables | |
*/ | |
let FIRMWARE_VERSION; | |
let MQTT_TOPIC_PREFIX; | |
let COMPONENT_CONFIG_DICT = {}; |
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 announce(topicPrefix) { | |
MQTT.publish(topicPrefix + "/online", "true") | |
Shelly.call( | |
"Sys.GetConfig", | |
{}, | |
function(systemConfig, errorCode, errorMessage, data) { | |
if (systemConfig.device !== undefined) { | |
data.payload.id = "shellyplus1-" + systemConfig.device.mac | |
data.payload.mac = systemConfig.device.mac |