added mock large qty autos
This commit is contained in:
ari committed 2022-07-15 12:37:10 -04:00
1 parent d8a2dd53d5
commit e769a8e798
13 files changed
+6929 -16

No files matched your search

+2 -2
View File
@@ -10,9 +10,9 @@ def find_hass_config() -> HassConfig:
"""Try to find HASS config."""
if config("USE_EXAMPLE_REPO", False, cast=bool):
print("using USE_EXAMPLE_REPO")
from tests.utils import create_copy_of_example_config
from tests.utils import create_copy_of_example_config, HA_CONFIG3_EXAMPLE
path = create_copy_of_example_config()
path = create_copy_of_example_config(HA_CONFIG3_EXAMPLE)
print("|-> ", path)
return HassConfig(path)
@@ -0,0 +1,77 @@
'1616887975473':
Type: HA
'1616888026264':
Type: HA
'1619371298367':
Room: Living
Type: Button
'1620239986670':
Room: Kitchen
Type: Button
'1620324780561':
Room: Kitchen
Type: Button
'1621352850204':
Room: Kitchen
Type: Button
'1622210698281':
Room: Kitchen
Type: Button
'1622769811245':
Room: Living
Type: Button
'1623430479201':
Room: Baby
Type: Button
'1623642118976':
Room: Baby
Type: Button
'1624640900951':
Room: Baby
Type: Button
'1628024070687':
Room: Baby
Type: Routine
'1628024123214':
Room: Baby
Type: Routine
'1628444671951':
Room: Office
Type: Window
'1629309267204':
Room: Balcony
Type: Door
'1629422438707':
Type: Routine
'1634497376234':
Room: Baby
Type: Button
'1635539262562':
Type: Routine
'1636428429596':
Type: Routine
'1639500650865':
Room: Bedroom
Type: Door
'1641617168123':
Type: Ensure Power
'1648071019802':
Type: Ensure Power
'1649426399020':
Room: Office
Type: Motion
'1649432254675':
Room: Baby
Type: Routine
'1649726828269':
Climate: Heat
Type: Climate
'1649727810678':
Climate: Time
Type: Climate
'1649820885714':
Type: Routine
'1649947692702':
BadOne: true
Room: Bedroom
Type: Button
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,2 @@
# empty configuration file
cloud:
+1
View File
@@ -13,6 +13,7 @@ THIS_FOLDER = Path(__file__).parent
SAMPLES_FOLDER = THIS_FOLDER / "samples"
HA_CONFIG_EXAMPLE = SAMPLES_FOLDER / "config"
HA_CONFIG2_EXAMPLE = SAMPLES_FOLDER / "config-2"
HA_CONFIG3_EXAMPLE = SAMPLES_FOLDER / "config-3"
def get_example_automation_loader(
@@ -6,7 +6,7 @@ import { Page } from "components/Page";
import { DEFAULT_DIMS } from "components/DAGGraph/elements/constants";
export default {
title: "App/AutomationList/Connected",
title: "App/AutomationList/MockConnected",
component: ConnectedAutomationList,
parameters: { actions: { argTypesRegex: "^on.*" } },
args: {
@@ -19,7 +19,7 @@ import { ButtonNodeMaker } from "../nodes/ButtonNode";
import { AddIcon } from "components/Icons";
import { useDAGElementsState } from "./state";
import AddBox from "@mui/icons-material/AddBox";
import { DAGGraphChooseUpdater, DAGGraphUpdater } from "../updater";
import { DAGGraphChooseUpdater } from "../updater";
import { getSpecialNodeMaker, makeSpecialNodeMaker } from "./specialnodes";
import { getNodeSubType } from "../../../utils/automations";
import DeleteForeverIcon from "@mui/icons-material/DeleteForever";
+1 -4
View File
@@ -1,8 +1,5 @@
import { FC, useState } from "react";
import {
AutomationActionData,
AutomationSequenceNode,
} from "types/automations";
import { AutomationSequenceNode } from "types/automations";
import { useHA } from "haService";
import { ModalState } from "./board/types";
import { createUpdater } from "./updater";
@@ -3,7 +3,6 @@ import { NodeTypes } from "react-flow-renderer";
import { makeNodeMaker } from "./NodeMaker";
import { DAGDims } from "../elements/types";
export type NodeManager = typeof NodeManager;
export const NodeManager = (() => {
const nodeTypes: NodeTypes = {};
return {
@@ -11,7 +11,6 @@ import {
RepeatAction,
ParallelAction,
} from "types/automations/actions";
import { ScriptConditionField } from "types/automations/common";
import { convertScriptConditionFieldToAutomationConditions } from "utils/automations";
import { AutomationNode } from "types/automations";
@@ -8,7 +8,7 @@ export const ActionChooseState: OptionManager<ChooseAction> = {
choose: [],
}),
isReady: () => true,
Component: ({}) => {
Component: () => {
return <></>;
},
};
@@ -1,8 +1,6 @@
import InputNumber from "components/Inputs/InputNumber";
import InputYaml from "components/Inputs/InputYaml";
import { useState } from "react";
import { RepeatAction } from "types/automations/actions";
import { OptionManager, updateActionData } from "./OptionManager";
import { OptionManager } from "./OptionManager";
import { InputAutoComplete } from "components/Inputs/InputAutoComplete";
const determineType = (repeatNode: RepeatAction["repeat"]) =>
@@ -16,7 +14,7 @@ export const ActionRepeatState: OptionManager<RepeatAction> = {
sequence: [],
},
}),
isReady: ({}) => true,
isReady: () => true,
Component: ({ state, setState }) => {
const repeatType = determineType(state.repeat);
return (
-1
View File
@@ -8,7 +8,6 @@ import {
} from "types/automations/common";
import { AutomationTriggerZone } from "types/automations/triggers";
import StopIcon from "@mui/icons-material/PanToolOutlined";
import { RepeatAction } from "types/automations/actions";
export interface Namer {
getEntityName(entity_id: string | string[], maxEntities?: number): string;
getDeviceName(device_id: string): string;