Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab4997494d | ||
|
|
83b1c85043 | ||
|
|
7526b578ba | ||
|
|
c461640957 | ||
|
|
fd0a0aa0c4 |
No files matched your search
+8
-136
@@ -1,5 +1,13 @@
|
|||||||
# Changelog 
|
# Changelog 
|
||||||
|
|
||||||
|
## [0.7.1] Bugfixes + Italian!
|
||||||
|
|
||||||
|
- Added support for automations that do not have an `id`
|
||||||
|
- Added Italian
|
||||||
|
- Merged grammar fixes for french
|
||||||
|
- Fixed up strange centering styling bug
|
||||||
|
- Replaced more non-multilingual texts with multilingual text
|
||||||
|
|
||||||
## [0.7.0] Configuration Menu / Light Mode / Lang Support
|
## [0.7.0] Configuration Menu / Light Mode / Lang Support
|
||||||
|
|
||||||
- Added configuration menu
|
- Added configuration menu
|
||||||
@@ -17,11 +25,6 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## [0.6.2] - Patches
|
|
||||||
|
|
||||||
- Attempting to increasing websocket file limit
|
|
||||||
- Support for all !include directives
|
|
||||||
|
|
||||||
## [0.6.1] - v0.6.0 Split Config Support & Better Error handling!
|
## [0.6.1] - v0.6.0 Split Config Support & Better Error handling!
|
||||||
|
|
||||||
- Added visual support for split config (this was a heavy refactor!)
|
- Added visual support for split config (this was a heavy refactor!)
|
||||||
@@ -37,11 +40,6 @@
|
|||||||
- Better global error capture
|
- Better global error capture
|
||||||

|

|
||||||
|
|
||||||
## [0.5.3] - Bug Fixes
|
|
||||||
|
|
||||||
- Redirecting `/` to `/web` to resolve container install strangeness reported in https://github.com/asosnovsky/Shortumation/issues/125
|
|
||||||
- Fixed missing flag that caused the automation to explode in https://github.com/asosnovsky/Shortumation/issues/124
|
|
||||||
|
|
||||||
## [0.5.2] - Better Controls
|
## [0.5.2] - Better Controls
|
||||||
|
|
||||||
- Add automation trigger
|
- Add automation trigger
|
||||||
@@ -62,11 +60,6 @@
|
|||||||
|
|
||||||
- Websockets now live-refresh when updates occur
|
- Websockets now live-refresh when updates occur
|
||||||
|
|
||||||
## [0.4.0] - Depedency update
|
|
||||||
|
|
||||||
- Core dependency updates
|
|
||||||
- Python port is now dynamically set
|
|
||||||
|
|
||||||
## [0.3.4] - Condition/Trigger Editor Upgrades!
|
## [0.3.4] - Condition/Trigger Editor Upgrades!
|
||||||
|
|
||||||
- Many condition editor fixes
|
- Many condition editor fixes
|
||||||
@@ -83,19 +76,6 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## [0.3.2] - Fixed Addon Image for arm-based devices
|
|
||||||
|
|
||||||
- Using hypercon instead of uvicorn (this losses the rust dependency which makes it easier to install on arm)
|
|
||||||
- Pre-building web assets outside of docker (this takes the image size down and speeds up instaltion of addon)
|
|
||||||
- Updated build scripts to actually fail installation when build/prep steps fail
|
|
||||||
- Ensured that builds for all architecture run successfully
|
|
||||||
- Re-worked github actions (quicker test phases)
|
|
||||||
|
|
||||||
## [0.3.1] - Increased Pagination + Restricted Repeat Node
|
|
||||||
|
|
||||||
- Increased pagination to display up to 10,000 autos for now
|
|
||||||
- Repeat node now has types
|
|
||||||
|
|
||||||
## [0.3.0] - Complete Refactor of Graphs
|
## [0.3.0] - Complete Refactor of Graphs
|
||||||
|
|
||||||
- Added visual support for
|
- Added visual support for
|
||||||
@@ -114,113 +94,5 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## [0.1.22] - Many Visual improvements
|
|
||||||
|
|
||||||
- Deprecated several custom components in favor of mui.com
|
|
||||||
- Device Editor now has support for 99% of diplay types
|
|
||||||
- Condition Device is implemented
|
|
||||||
- Improved naming autogen for trigger & choose
|
|
||||||
|
|
||||||
## [0.1.21] - Service Editor
|
|
||||||
|
|
||||||
- first version of service editor
|
|
||||||
- reloading automations on save
|
|
||||||
|
|
||||||
## [0.1.20] - UI Bugfixes
|
|
||||||
|
|
||||||
- Using MUI elements for input time
|
|
||||||
- Added delay action / wait_on_triggers action
|
|
||||||
- Added enabled/disabled flag in node editor
|
|
||||||
- Optional flip vertical during desktop mode
|
|
||||||
- Fixed up modal clipping
|
|
||||||
|
|
||||||
## [0.1.19] - Vertical mobile mode
|
|
||||||
|
|
||||||
- in mobile mode we draw the graphs vertically now
|
|
||||||
|
|
||||||
## [0.1.17] - Websockets
|
|
||||||
|
|
||||||
- Connected to HA main websocket -- now we retrieve real-time information about
|
|
||||||
|
|
||||||
- Device names
|
|
||||||
- Entity names/ids
|
|
||||||
|
|
||||||
- Autocomplete for devices and entities
|
|
||||||
|
|
||||||
## [0.1.14] - Material UI + Autocomplete
|
|
||||||
|
|
||||||
- Brought some Material UI elements for input and text
|
|
||||||
- Autocomplete for tags
|
|
||||||
- Using 'id' as alias for trigger (as it seems to break HA otherwise)
|
|
||||||
- Not using 'alias' for conditions, always auto-generating it (again, this used to break HA)
|
|
||||||
- Added missing `data` object to service-actions
|
|
||||||
|
|
||||||
## [0.1.13] - YAML
|
|
||||||
|
|
||||||
- Better YAML
|
|
||||||
- Rewrote yaml parser/loader to use pyyaml and safe mode
|
|
||||||
- Cleaned up description vs alias
|
|
||||||
|
|
||||||
## [0.1.12] - Less Intense Error Messages
|
|
||||||
|
|
||||||
- Added more node-based errors (this way it's easier to see where validations failed)
|
|
||||||
- Made the validators less strict in order to capture more edge cases that HA supports
|
|
||||||
- Nicer auto-generated descriptions for some trigger nodes
|
|
||||||
|
|
||||||
## [0.1.10] - More Bug Fixes
|
|
||||||
|
|
||||||
- Allowing null or undefined values for metadata fields
|
|
||||||
- Trigger.platform==time will now have the .at property better supported
|
|
||||||
|
|
||||||
## [0.1.9] - Fixed up invalid types for various triggers
|
|
||||||
|
|
||||||
- Some triggers had invalid types and were causing a false-positive validation
|
|
||||||
|
|
||||||
## [0.1.8] - Support for Malformed Automations
|
|
||||||
|
|
||||||
- API will no longer error out on missing values or invalid lists
|
|
||||||
- Frontend has support for displaying bad automations
|
|
||||||
|
|
||||||
## [0.1.6] - Mobile Mode
|
|
||||||
|
|
||||||
- Improved mobile mode
|
|
||||||
- Fixed up arrow styles due to typos
|
|
||||||
- Added selection color
|
|
||||||
|
|
||||||
## [0.1.2] - Docker Hub Images
|
|
||||||
|
|
||||||
- Publishing images to docker hub is now stable
|
|
||||||
|
|
||||||
## [0.0.15] - Publish to dockerhub
|
|
||||||
|
|
||||||
- Publishing images to docker hub
|
|
||||||
|
|
||||||
## [0.0.14] - Using vanila ha yaml
|
|
||||||
|
|
||||||
- Supporing vanilla out of the box HA yaml as oppose to parsing them (no more $smType)
|
|
||||||
- Conditions have now a more a explicit node
|
|
||||||
|
|
||||||
## [0.0.13] - Better Styling with react-flow
|
|
||||||
|
|
||||||
- Fixed up styling (using react-flow)
|
|
||||||
- cleaned up some button styles
|
|
||||||
|
|
||||||
## [0.0.12] - Tags
|
|
||||||
|
|
||||||
- Added tag management system for automations
|
|
||||||
|
|
||||||
## [0.0.11] - Zoom
|
|
||||||
|
|
||||||
- Added lazy saving
|
|
||||||
|
|
||||||
## [0.0.10] - Zoom
|
|
||||||
|
|
||||||
- Introducing Zoom!
|
|
||||||
|
|
||||||
## [0.0.9] - First Working Version
|
|
||||||
|
|
||||||
- Instalable verion via github
|
|
||||||
- Initial POC done
|
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
@@ -11,7 +11,7 @@ from src.hass_config.loader import HassConfig
|
|||||||
def make_automation_router(hass_config: HassConfig) -> APIRouter:
|
def make_automation_router(hass_config: HassConfig) -> APIRouter:
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.post("/list")
|
@router.post("/list", response_model_exclude_unset=True, response_model_exclude_none=True)
|
||||||
def list_autos(body: ListParams) -> ListData[ExtenededAutomation]:
|
def list_autos(body: ListParams) -> ListData[ExtenededAutomation]:
|
||||||
automations = AutomationManager(hass_config)
|
automations = AutomationManager(hass_config)
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -330,6 +330,8 @@ def load_automation_path(
|
|||||||
def clean_automation(auto_raw: dict):
|
def clean_automation(auto_raw: dict):
|
||||||
return {
|
return {
|
||||||
**auto_raw,
|
**auto_raw,
|
||||||
|
"alias": auto_raw.get("alias", "") or "",
|
||||||
|
"description": auto_raw.get("description", "") or "",
|
||||||
"condition": ifempty_or_null_then_list(load_conditions(auto_raw.get("condition", []))),
|
"condition": ifempty_or_null_then_list(load_conditions(auto_raw.get("condition", []))),
|
||||||
"action": ifempty_or_null_then_list(load_conditions(auto_raw.get("action", []))),
|
"action": ifempty_or_null_then_list(load_conditions(auto_raw.get("action", []))),
|
||||||
"trigger": ifempty_or_null_then_list(normalize_obj(auto_raw.get("trigger", []))),
|
"trigger": ifempty_or_null_then_list(normalize_obj(auto_raw.get("trigger", []))),
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ AutomationExtractedIter = Iterator[ExtractedAutomation]
|
|||||||
|
|
||||||
class BaseAutomation(BaseModel):
|
class BaseAutomation(BaseModel):
|
||||||
id: Optional[str]
|
id: Optional[str]
|
||||||
alias: Optional[str] = None
|
alias: str = ""
|
||||||
description: Optional[str] = None
|
description: str = ""
|
||||||
trigger_variables: Optional[dict[str, Union[str, int, bool, float]]] = None
|
trigger_variables: Optional[dict[str, Union[str, int, bool, float]]] = None
|
||||||
mode: str = "single"
|
mode: str = "single"
|
||||||
trigger: list[dict] = []
|
trigger: list[dict] = []
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ class automation_update_tests(BaseTestCase):
|
|||||||
)
|
)
|
||||||
autos = resp.json()["data"]
|
autos = resp.json()["data"]
|
||||||
self.assertEqual(resp.json()["totalItems"], self.test_params["total"])
|
self.assertEqual(resp.json()["totalItems"], self.test_params["total"])
|
||||||
self.assertNotIn("i am new", set([a["id"] for a in autos]))
|
self.assertNotIn("i am new", set([a.get("id", "") for a in autos]))
|
||||||
resp = self.client.post(
|
resp = self.client.post(
|
||||||
"/automations/item",
|
"/automations/item",
|
||||||
json=Automation(
|
json=Automation(
|
||||||
@@ -262,7 +262,7 @@ class automation_update_tests(BaseTestCase):
|
|||||||
)
|
)
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
self.assertEqual(data["totalItems"], self.test_params["total"] + 1)
|
self.assertEqual(data["totalItems"], self.test_params["total"] + 1)
|
||||||
self.assertIn("i am new", set([a["id"] for a in data["data"]]))
|
self.assertIn("i am new", set([a.get("id", "") for a in data["data"]]))
|
||||||
|
|
||||||
def test_update_some(self):
|
def test_update_some(self):
|
||||||
resp = self.client.post(
|
resp = self.client.post(
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
name: Shortumation
|
name: Shortumation
|
||||||
version: v0.7.0
|
version: v0.7.1
|
||||||
slug: shortumation
|
slug: shortumation
|
||||||
image: "asosnovsky/shortumation-{arch}"
|
image: "asosnovsky/shortumation-{arch}"
|
||||||
url: "https://github.com/asosnovsky/Shortumation"
|
url: "https://github.com/asosnovsky/Shortumation"
|
||||||
|
|||||||
@@ -34,15 +34,9 @@ export const makeRemoteAPI = (baseURL: string): API => ({
|
|||||||
return response;
|
return response;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
let error = String(err);
|
|
||||||
|
|
||||||
if (err instanceof Error) {
|
|
||||||
error += ` ${err.stack}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ok: false,
|
ok: false,
|
||||||
error,
|
error: `Server error: ${method} ${path}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ export const MissingAutoInConfig = make({
|
|||||||
entity_id: `automation.${auto1.id}`,
|
entity_id: `automation.${auto1.id}`,
|
||||||
attributes: {
|
attributes: {
|
||||||
id: auto1.id,
|
id: auto1.id,
|
||||||
friendly_name: auto1.alias,
|
friendly_name: auto1.alias ?? auto1.id ?? "",
|
||||||
},
|
},
|
||||||
context: { id: "", parent_id: null, user_id: null },
|
context: { id: "", parent_id: null, user_id: null },
|
||||||
last_changed: "",
|
last_changed: "",
|
||||||
|
|||||||
@@ -29,10 +29,12 @@ export const makeStory = <
|
|||||||
};
|
};
|
||||||
const Template: ComponentStory<T> = (args) => {
|
const Template: ComponentStory<T> = (args) => {
|
||||||
let api: ApiService;
|
let api: ApiService;
|
||||||
|
const connApi = useConnectedApiService();
|
||||||
|
const mockApi = useMockApiService([]);
|
||||||
if (useLiveApi) {
|
if (useLiveApi) {
|
||||||
api = useConnectedApiService();
|
api = connApi;
|
||||||
} else {
|
} else {
|
||||||
api = useMockApiService([]);
|
api = mockApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, { FC, useEffect, useState } from "react";
|
import React, { FC, useEffect, useState } from "react";
|
||||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
import { makeStory } from "devUtils";
|
||||||
import { Page } from "components/Page";
|
|
||||||
import { useHA } from "haService";
|
import { useHA } from "haService";
|
||||||
import InputYaml from "components/Inputs/Base/InputYaml";
|
import InputYaml from "components/Inputs/Base/InputYaml";
|
||||||
import { InputList } from "components/Inputs/InputList";
|
import { InputList } from "components/Inputs/InputList";
|
||||||
@@ -78,8 +77,6 @@ const Test: FC = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
import { makeStory } from "devUtils";
|
|
||||||
|
|
||||||
const { make, componentMeta } = makeStory({
|
const { make, componentMeta } = makeStory({
|
||||||
Component: Test,
|
Component: Test,
|
||||||
meta: {
|
meta: {
|
||||||
|
|||||||
Reference in new issue
Block a user