Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bcbcaa801 | ||
|
|
b479476833 | ||
|
|
baa31ab649 | ||
|
|
dc7c6273e4 | ||
|
|
2942b6173b | ||
|
|
bcfc648011 |
No files matched your search
@@ -1,5 +1,12 @@
|
|||||||
# Changelog 
|
# Changelog 
|
||||||
|
|
||||||
|
## [0.5.2] - Better Controls
|
||||||
|
|
||||||
|
- Add automation trigger
|
||||||
|
- Speed dial on the bottom
|
||||||
|
<img src="https://user-images.githubusercontent.com/7451445/183231968-9891bbb4-5c7c-4e05-b804-36978c809a5c.png" width="200px"/>
|
||||||
|
- Infinite undos <img src="https://user-images.githubusercontent.com/7451445/183231977-ed000017-2886-4a57-b5fb-c7e527bf3894.png" width="200px"/>
|
||||||
|
|
||||||
## [0.5.1] - Sidebar!
|
## [0.5.1] - Sidebar!
|
||||||
|
|
||||||
- completely redesigned the sidebar!
|
- completely redesigned the sidebar!
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Shortumation 
|
# <img src="logo.png" height="40x"/> Shortumation 
|
||||||
|
|
||||||
[](https://github.com/asosnovsky/Shortumation/actions/workflows/test.yml) [](https://github.com/asosnovsky/Shortumation/actions/workflows/build.yml)
|
[](https://github.com/asosnovsky/Shortumation/actions/workflows/test.yml) [](https://github.com/asosnovsky/Shortumation/actions/workflows/build.yml)
|
||||||
|
|
||||||
@@ -6,7 +6,9 @@
|
|||||||
| ------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| Version |  |  |
|
| Version |  |  |
|
||||||
|
|
||||||
A [home-assistant addon](https://www.home-assistant.io/addons/) for a better UI for managing and writing your automations. We provide a way to visualize your automation using a visual-programming language that draws inspirations from [Node-Red](https://nodered.org/).
|
A [home-assistant addon](https://www.home-assistant.io/addons/) for a better UI for managing and writing your automations. We provide a way to visualize your automation using a visual-programming language that draws inspirations from [Node-Red](https://nodered.org/).
|
||||||
|
|
||||||
|
<img src="./assets/comparisons.png">
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -46,6 +48,8 @@ Add the repository URL under **Supervisor → Add-on store → ⋮ → Manage ad
|
|||||||
|
|
||||||
It should now appear in your `Add-on Store` and you should be able to install it!
|
It should now appear in your `Add-on Store` and you should be able to install it!
|
||||||
|
|
||||||
|
**Please note that you may need to enable advance mode in your settings first!**
|
||||||
|
|
||||||
### Containerized or HA Core
|
### Containerized or HA Core
|
||||||
|
|
||||||
Please note that this way of using Shortumation is **not future proof**.
|
Please note that this way of using Shortumation is **not future proof**.
|
||||||
|
|||||||
+11
-1
@@ -1,6 +1,7 @@
|
|||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
from fastapi.staticfiles import StaticFiles
|
from fastapi.staticfiles import StaticFiles
|
||||||
|
from fastapi.responses import RedirectResponse
|
||||||
|
|
||||||
from src.automations.manager import AutomationManager
|
from src.automations.manager import AutomationManager
|
||||||
from src.env import API_PREFIX, ORIGIN, ROOT_FOLDER
|
from src.env import API_PREFIX, ORIGIN, ROOT_FOLDER
|
||||||
@@ -10,7 +11,8 @@ from .routes import automations, details, ping, socket
|
|||||||
|
|
||||||
def make_app(automation_mgr: AutomationManager) -> FastAPI:
|
def make_app(automation_mgr: AutomationManager) -> FastAPI:
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
if (ROOT_FOLDER / "web").exists():
|
has_web_folder = (ROOT_FOLDER / "web").exists()
|
||||||
|
if has_web_folder:
|
||||||
app.mount(
|
app.mount(
|
||||||
f"{API_PREFIX}/web",
|
f"{API_PREFIX}/web",
|
||||||
StaticFiles(
|
StaticFiles(
|
||||||
@@ -19,6 +21,7 @@ def make_app(automation_mgr: AutomationManager) -> FastAPI:
|
|||||||
),
|
),
|
||||||
name="web",
|
name="web",
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("WARN: could not find web folder")
|
print("WARN: could not find web folder")
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
@@ -36,4 +39,11 @@ def make_app(automation_mgr: AutomationManager) -> FastAPI:
|
|||||||
details.make_details_router(automation_mgr.hass_config), prefix=f"{API_PREFIX}/details"
|
details.make_details_router(automation_mgr.hass_config), prefix=f"{API_PREFIX}/details"
|
||||||
)
|
)
|
||||||
app.include_router(socket.router, prefix=f"{API_PREFIX}/socket")
|
app.include_router(socket.router, prefix=f"{API_PREFIX}/socket")
|
||||||
|
|
||||||
|
@app.get("/")
|
||||||
|
def get_index():
|
||||||
|
if has_web_folder:
|
||||||
|
return RedirectResponse("/web")
|
||||||
|
return RedirectResponse("/details")
|
||||||
|
|
||||||
return app
|
return app
|
||||||
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 2.9 MiB |
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
name: Shortumation
|
name: Shortumation
|
||||||
version: v0.5.1
|
version: v0.5.2
|
||||||
slug: shortumation
|
slug: shortumation
|
||||||
image: asosnovsky/shortumation-{arch}
|
image: asosnovsky/shortumation-{arch}
|
||||||
url: "https://github.com/asosnovsky/Shortumation"
|
url: "https://github.com/asosnovsky/Shortumation"
|
||||||
|
|||||||
@@ -12,9 +12,12 @@ services:
|
|||||||
shortumation:
|
shortumation:
|
||||||
# make sure to replace the ARCH with whatever system you are running!
|
# make sure to replace the ARCH with whatever system you are running!
|
||||||
image: "asosnovsky/shortumation-${ARCH:-amd64}:${SHORTUMATION_VERSION:-latest}"
|
image: "asosnovsky/shortumation-${ARCH:-amd64}:${SHORTUMATION_VERSION:-latest}"
|
||||||
network_mode: host
|
ports:
|
||||||
|
- 8000:8000
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
environment:
|
environment:
|
||||||
- SUPERVISOR_TOKEN=${SUPERVISOR_TOKEN}
|
- SUPERVISOR_TOKEN=${SUPERVISOR_TOKEN}
|
||||||
- HASSIO_WS=ws://0.0.0.0:8123/api/websocket
|
- HASSIO_WS=ws://host.docker.internal:8123/api/websocket
|
||||||
@@ -120,3 +120,54 @@ export const MissingAutoInConfig = make({
|
|||||||
entitySource: {},
|
entitySource: {},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
export const BadAutomation = make({
|
||||||
|
haProps: {
|
||||||
|
loading: false,
|
||||||
|
entities: {
|
||||||
|
[`automation.${auto1.metadata.id}`]: {
|
||||||
|
entity_id: `automation.${auto1.metadata.id}`,
|
||||||
|
attributes: {
|
||||||
|
id: "test",
|
||||||
|
},
|
||||||
|
context: { id: "", parent_id: null, user_id: null },
|
||||||
|
last_changed: "",
|
||||||
|
last_updated: "",
|
||||||
|
state: "on",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
entitySource: {},
|
||||||
|
},
|
||||||
|
automations: [
|
||||||
|
{
|
||||||
|
tags: {},
|
||||||
|
metadata: {
|
||||||
|
id: "test",
|
||||||
|
mode: "single",
|
||||||
|
alias: "Light.Tank_Day",
|
||||||
|
description: "",
|
||||||
|
},
|
||||||
|
trigger: [
|
||||||
|
{
|
||||||
|
platform: "sun",
|
||||||
|
event: "sunrise",
|
||||||
|
offset: "30",
|
||||||
|
} as any,
|
||||||
|
{ whoAmI: "bad node is who" } as any,
|
||||||
|
],
|
||||||
|
condition: [{ whoAmI: "bad node is who" } as any],
|
||||||
|
sequence: [
|
||||||
|
{ scene: "scene.light_day" } as any,
|
||||||
|
{ whoAmI: "bad node is who" } as any,
|
||||||
|
{
|
||||||
|
service: "input_select.set_options",
|
||||||
|
target: {
|
||||||
|
entity_id: "input_select.tank_light_mode",
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
options: "day",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
@@ -6,7 +6,7 @@ export const NODE_HEIGHT = 80 as const;
|
|||||||
export const DEFAULT_DIMS: DAGDims = {
|
export const DEFAULT_DIMS: DAGDims = {
|
||||||
collection: {
|
collection: {
|
||||||
height: NODE_HEIGHT * 3,
|
height: NODE_HEIGHT * 3,
|
||||||
width: NODE_WIDTH * 1.5,
|
width: NODE_WIDTH * 2.5,
|
||||||
},
|
},
|
||||||
node: {
|
node: {
|
||||||
height: NODE_HEIGHT,
|
height: NODE_HEIGHT,
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const useDAGElementsState = () => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getIsClosedActions(nodeId: string, node: AutomationNode) {
|
getIsClosedActions(nodeId: string, node: AutomationNode) {
|
||||||
if (isSpecialNode(getNodeSubType(node))) {
|
if (isSpecialNode(getNodeSubType(node, true))) {
|
||||||
return {
|
return {
|
||||||
isClosed: this.get(nodeId).isClosed ?? false,
|
isClosed: this.get(nodeId).isClosed ?? false,
|
||||||
setIsClosed: (v: boolean) => this.set(nodeId, "isClosed", v),
|
setIsClosed: (v: boolean) => this.set(nodeId, "isClosed", v),
|
||||||
|
|||||||
Reference in new issue
Block a user