mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +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,
|
||||
returnResponse = false
|
||||
) => {
|
||||
if (this.hass?.debugConnection) {
|
||||
if (__DEV__ || this.hass?.debugConnection) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(
|
||||
"Calling service",
|
||||
@ -115,7 +115,7 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
|
||||
) {
|
||||
return { context: { id: "" } };
|
||||
}
|
||||
if (this.hass?.debugConnection) {
|
||||
if (__DEV__ || this.hass?.debugConnection) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
"Error calling service",
|
||||
@ -167,7 +167,7 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
|
||||
) => fetchWithAuth(auth, `${auth.data.hassUrl}${path}`, init),
|
||||
// For messages that do not get a response
|
||||
sendWS: (msg) => {
|
||||
if (this.hass?.debugConnection) {
|
||||
if (__DEV__ || this.hass?.debugConnection) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Sending", msg);
|
||||
}
|
||||
@ -175,14 +175,14 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
|
||||
},
|
||||
// For messages that expect a response
|
||||
callWS: <R>(msg) => {
|
||||
if (this.hass?.debugConnection) {
|
||||
if (__DEV__ || this.hass?.debugConnection) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Sending", msg);
|
||||
}
|
||||
|
||||
const resp = conn.sendMessagePromise<R>(msg);
|
||||
|
||||
if (this.hass?.debugConnection) {
|
||||
if (__DEV__ || this.hass?.debugConnection) {
|
||||
resp.then(
|
||||
// eslint-disable-next-line no-console
|
||||
(result) => console.log("Received", result),
|
||||
|
Loading…
x
Reference in New Issue
Block a user