mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Revert remove hass debug connection in dev (#23356)
This commit is contained in:
parent
ecc704e6ac
commit
c532a9023a
@ -89,7 +89,7 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
|
|||||||
notifyOnError = true,
|
notifyOnError = true,
|
||||||
returnResponse = false
|
returnResponse = false
|
||||||
) => {
|
) => {
|
||||||
if (this.hass?.debugConnection) {
|
if (__DEV__ || this.hass?.debugConnection) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(
|
console.log(
|
||||||
"Calling service",
|
"Calling service",
|
||||||
@ -115,7 +115,7 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
|
|||||||
) {
|
) {
|
||||||
return { context: { id: "" } };
|
return { context: { id: "" } };
|
||||||
}
|
}
|
||||||
if (this.hass?.debugConnection) {
|
if (__DEV__ || this.hass?.debugConnection) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error(
|
console.error(
|
||||||
"Error calling service",
|
"Error calling service",
|
||||||
@ -167,7 +167,7 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
|
|||||||
) => fetchWithAuth(auth, `${auth.data.hassUrl}${path}`, init),
|
) => fetchWithAuth(auth, `${auth.data.hassUrl}${path}`, init),
|
||||||
// For messages that do not get a response
|
// For messages that do not get a response
|
||||||
sendWS: (msg) => {
|
sendWS: (msg) => {
|
||||||
if (this.hass?.debugConnection) {
|
if (__DEV__ || this.hass?.debugConnection) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log("Sending", msg);
|
console.log("Sending", msg);
|
||||||
}
|
}
|
||||||
@ -175,14 +175,14 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
|
|||||||
},
|
},
|
||||||
// For messages that expect a response
|
// For messages that expect a response
|
||||||
callWS: <R>(msg) => {
|
callWS: <R>(msg) => {
|
||||||
if (this.hass?.debugConnection) {
|
if (__DEV__ || this.hass?.debugConnection) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log("Sending", msg);
|
console.log("Sending", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
const resp = conn.sendMessagePromise<R>(msg);
|
const resp = conn.sendMessagePromise<R>(msg);
|
||||||
|
|
||||||
if (this.hass?.debugConnection) {
|
if (__DEV__ || this.hass?.debugConnection) {
|
||||||
resp.then(
|
resp.then(
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
(result) => console.log("Received", result),
|
(result) => console.log("Received", result),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user