Generic Commit; Most likely a fix or small feature
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { Config } from "../config/config.js";
|
import { Config } from "../config/config.js";
|
||||||
import { logInfo, logWarning } from "./logger.js";
|
import { logWarning } from "./logger.js";
|
||||||
|
|
||||||
type HomeAssistantEntity = {
|
type HomeAssistantEntity = {
|
||||||
entity_id: string;
|
entity_id: string;
|
||||||
@@ -88,7 +88,7 @@ async function sendRequestToHomeAssistantStates(
|
|||||||
entity_id: string,
|
entity_id: string,
|
||||||
): Promise<HomeAssistantEntity> {
|
): Promise<HomeAssistantEntity> {
|
||||||
const url = `${Config.homeassistant.api_url}states/"${entity_id}`
|
const url = `${Config.homeassistant.api_url}states/"${entity_id}`
|
||||||
logInfo(`sending request to ${url}`)
|
//logInfo(`sending request to ${url}`)
|
||||||
|
|
||||||
const response = await axios.get<HomeAssistantEntity>(
|
const response = await axios.get<HomeAssistantEntity>(
|
||||||
url,
|
url,
|
||||||
@@ -106,7 +106,7 @@ async function sendRequestToHomeAssistantWebhook(
|
|||||||
webhook_id: string,
|
webhook_id: string,
|
||||||
): Promise<unknown> {
|
): Promise<unknown> {
|
||||||
const url = `${Config.homeassistant.api_url}webhook/${webhook_id}`
|
const url = `${Config.homeassistant.api_url}webhook/${webhook_id}`
|
||||||
logInfo(`sending request to ${url}`)
|
//logInfo(`sending request to ${url}`)
|
||||||
|
|
||||||
const response = await axios.post<HomeAssistantEntity>(url);
|
const response = await axios.post<HomeAssistantEntity>(url);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user