Turned all 'print' messages into _LOGGER.debug
This commit is contained in:
@@ -176,7 +176,7 @@ class LocaltuyaClimate(LocalTuyaEntity, ClimateEntity):
|
||||
self._has_presets = self.has_config(CONF_ECO_DP) or self.has_config(
|
||||
CONF_PRESET_DP
|
||||
)
|
||||
print("Initialized climate [{}]".format(self.name))
|
||||
_LOGGER.debug("Initialized climate [%s]", self.name)
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
|
@@ -3,10 +3,13 @@ import functools
|
||||
import hashlib
|
||||
import hmac
|
||||
import json
|
||||
import logging
|
||||
import time
|
||||
|
||||
import requests
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# Signature algorithm.
|
||||
def calc_sign(msg, key):
|
||||
@@ -55,7 +58,7 @@ class TuyaCloudApi:
|
||||
+ "\n/"
|
||||
+ url.split("//", 1)[-1].split("/", 1)[-1] # Url
|
||||
)
|
||||
# print("PAYLOAD: {}".format(payload))
|
||||
# _LOGGER.debug("PAYLOAD: %s", payload)
|
||||
return payload
|
||||
|
||||
async def async_make_request(self, method, url, body=None, headers={}):
|
||||
@@ -70,7 +73,7 @@ class TuyaCloudApi:
|
||||
"sign_method": "HMAC-SHA256",
|
||||
}
|
||||
full_url = self._base_url + url
|
||||
# print("\n" + method + ": [{}]".format(full_url))
|
||||
# _LOGGER.debug("\n" + method + ": [%s]", full_url)
|
||||
|
||||
if method == "GET":
|
||||
func = functools.partial(
|
||||
@@ -83,7 +86,7 @@ class TuyaCloudApi:
|
||||
headers=dict(default_par, **headers),
|
||||
data=json.dumps(body),
|
||||
)
|
||||
# print("BODY: [{}]".format(body))
|
||||
# _LOGGER.debug("BODY: [%s]", body)
|
||||
elif method == "PUT":
|
||||
func = functools.partial(
|
||||
requests.put,
|
||||
@@ -121,14 +124,13 @@ class TuyaCloudApi:
|
||||
|
||||
r_json = resp.json()
|
||||
if not r_json["success"]:
|
||||
# print(
|
||||
# "Request failed, reply is {}".format(
|
||||
# _LOGGER.debug(
|
||||
# "Request failed, reply is %s",
|
||||
# json.dumps(r_json, indent=2, ensure_ascii=False)
|
||||
# )
|
||||
# )
|
||||
return f"Error {r_json['code']}: {r_json['msg']}"
|
||||
|
||||
self.device_list = {dev["id"]: dev for dev in r_json["result"]}
|
||||
# print("DEV__LIST: {}".format(self.device_list))
|
||||
# _LOGGER.debug("DEV_LIST: %s", self.device_list)
|
||||
|
||||
return "ok"
|
||||
|
@@ -74,10 +74,6 @@ async def async_setup_entry(
|
||||
|
||||
if len(entities_to_setup) > 0:
|
||||
|
||||
if dev_id not in hass.data[DOMAIN][TUYA_DEVICES]:
|
||||
print("STRANO: {}".format(hass.data[DOMAIN][TUYA_DEVICES]))
|
||||
return
|
||||
|
||||
tuyainterface = hass.data[DOMAIN][TUYA_DEVICES][dev_id]
|
||||
|
||||
dps_config_fields = list(get_dps_for_platform(flow_schema))
|
||||
|
@@ -39,6 +39,7 @@ CONF_ACTION = "action"
|
||||
CONF_ADD_DEVICE = "add_device"
|
||||
CONF_EDIT_DEVICE = "edit_device"
|
||||
CONF_SETUP_CLOUD = "setup_cloud"
|
||||
CONF_NO_CLOUD = "no_cloud"
|
||||
|
||||
# light
|
||||
CONF_BRIGHTNESS_LOWER = "brightness_lower"
|
||||
|
@@ -75,7 +75,7 @@ class LocaltuyaCover(LocalTuyaEntity, CoverEntity):
|
||||
self._state = self._stop_cmd
|
||||
self._previous_state = self._state
|
||||
self._current_cover_position = 0
|
||||
print("Initialized cover [{}]".format(self.name))
|
||||
_LOGGER.debug("Initialized cover [%s]", self.name)
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
|
@@ -40,7 +40,7 @@ class LocaltuyaSwitch(LocalTuyaEntity, SwitchEntity):
|
||||
"""Initialize the Tuya switch."""
|
||||
super().__init__(device, config_entry, switchid, _LOGGER, **kwargs)
|
||||
self._state = None
|
||||
print("Initialized switch [{}]".format(self.name))
|
||||
_LOGGER.debug("Initialized switch [%s]", self.name)
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
@@ -117,8 +117,7 @@ class LocaltuyaVacuum(LocalTuyaEntity, StateVacuumEntity):
|
||||
|
||||
self._fan_speed = ""
|
||||
self._cleaning_mode = ""
|
||||
|
||||
print("Initialized vacuum [{}]".format(self.name))
|
||||
_LOGGER.debug("Initialized vacuum [%s]", self.name)
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
|
Reference in New Issue
Block a user