Setup esphome from this PR: esphome/esphome#5535 (Code is also here)
python3 -m venv .
bin/pip install .
bin/pip install setuptools
For each Shelly:
Setup esphome from this PR: esphome/esphome#5535 (Code is also here)
python3 -m venv .
bin/pip install .
bin/pip install setuptools
For each Shelly:
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. | |
* |
import SwiftUI | |
import UIKit | |
struct ContentView: View { | |
@State private var isLocked = false | |
@State private var isSheetVisible = false | |
var body: some View { | |
LockableView(isLocked: isLocked) { |
/*global Shelly, MQTT */ | |
/** | |
* Variables | |
*/ | |
let FIRMWARE_VERSION; | |
let MQTT_TOPIC_PREFIX; | |
let COMPONENT_CONFIG_DICT = {}; |
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 |