updated autmation api

This commit is contained in:
Ari committed 2022-04-13 14:27:20 -04:00
1 parent 32589b7c64
commit 6995136704
2 files changed
+6 -3

No files matched your search

+1 -2
View File
@@ -1,5 +1,5 @@
name: Shortumation
version: 0.0.7
version: 0.0.7g2
slug: shortumation
url: "https://github.com/asosnovsky/Shortumation"
description: "A homeassitant addon which provides better UI for automations & scripts."
@@ -16,7 +16,6 @@ ingress_port: 8000
ingress_entry: "web/"
panel_icon: mdi:home-automation
hassio_role: manager
auth_api: true
privileged:
- SYS_RAWIO
host_network: true
+5 -1
View File
@@ -4,8 +4,12 @@ import { makeRemoteAPI } from "./base";
import { useAPIService } from './core';
import {useMockAPI} from "./mock";
const locationPrefixWeb = window.location.pathname.match(/(.+)\/web/i);
export const useConnectedApiService = () => useAPIService(
makeAutomationAPI(makeRemoteAPI("/automations"))
makeAutomationAPI(makeRemoteAPI(
(!locationPrefixWeb ? '' : locationPrefixWeb[1]) + "/automations"
))
);
export const useMockApiService = (initialAutos: AutomationData[]) => useAPIService(
makeAutomationAPI(useMockAPI(initialAutos))