Skip to content

Commit

Permalink
Merge pull request #226 from elad-bar/Reduce-Info-Logging
Browse files Browse the repository at this point in the history
Changed all info messages to debug
  • Loading branch information
kramttocs committed Apr 12, 2024
2 parents d473a50 + 3229bc3 commit f6c9ca2
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion custom_components/blueiris/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def async_options_updated(hass: HomeAssistant, entry: ConfigEntry):
"""Triggered by config entry options updates."""
await handle_log_level(hass, entry)

_LOGGER.info(f"async_options_updated, Entry: {entry.as_dict()} ")
_LOGGER.debug(f"async_options_updated, Entry: {entry.as_dict()} ")

ha = get_ha(hass, entry.entry_id)

Expand Down
14 changes: 7 additions & 7 deletions custom_components/blueiris/api/blue_iris_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def async_post(self, data):
return result

async def initialize(self):
_LOGGER.info("Initializing BlueIris")
_LOGGER.debug("Initializing BlueIris")

try:
config_data = self.config_data
Expand Down Expand Up @@ -147,7 +147,7 @@ async def async_update(self):
await self.load_status()

async def load_session_id(self):
_LOGGER.info("Retrieving session ID")
_LOGGER.debug("Retrieving session ID")

request_data = {"cmd": "login"}

Expand All @@ -161,7 +161,7 @@ async def load_session_id(self):
self.is_logged_in = False

async def login(self):
_LOGGER.info("Performing login")
_LOGGER.debug("Performing login")

logged_in = False

Expand Down Expand Up @@ -239,7 +239,7 @@ async def load_status(self):
self.status[key] = data[key]

async def set_profile(self, profile_id):
_LOGGER.info(f"Setting profile {profile_id}")
_LOGGER.debug(f"Setting profile {profile_id}")

await self._set_profile(profile_id)

Expand All @@ -266,7 +266,7 @@ async def _set_profile(self, profile_id, check_lock=True):
self.status[key] = data[key]

async def set_schedule(self, schedule_name):
_LOGGER.info(f"Setting schedule {schedule_name}")
_LOGGER.debug(f"Setting schedule {schedule_name}")

await self._set_schedule(schedule_name)

Expand All @@ -293,7 +293,7 @@ async def _set_schedule(self, schedule_name, check_lock=True):
self.status[key] = data[key]

async def trigger_camera(self, camera_short_name):
_LOGGER.info(f"Triggering camera {camera_short_name}")
_LOGGER.debug(f"Triggering camera {camera_short_name}")

request_data = {
"cmd": "trigger",
Expand All @@ -303,7 +303,7 @@ async def trigger_camera(self, camera_short_name):
await self.async_verified_post(request_data)

async def move_to_preset(self, camera_short_name, preset):
_LOGGER.info(f"Moving {camera_short_name} to preset {preset}")
_LOGGER.debug(f"Moving {camera_short_name} to preset {preset}")
preset_value = 100 + preset
request_data = {
"cmd": "ptz",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/blueiris/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ async def async_setup_entry(hass, config_entry, async_add_devices):


async def async_unload_entry(_hass, config_entry):
_LOGGER.info(f"async_unload_entry {CURRENT_DOMAIN}: {config_entry}")
_LOGGER.debug(f"async_unload_entry {CURRENT_DOMAIN}: {config_entry}")

return True
6 changes: 3 additions & 3 deletions custom_components/blueiris/binary_sensors/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self):

async def async_added_to_hass_local(self):
"""Subscribe MQTT events."""
_LOGGER.info(f"Added new {self.name}")
_LOGGER.debug(f"Added new {self.name}")

def _immediate_update(self, previous_state: bool):
if previous_state != self.entity.state:
Expand All @@ -32,7 +32,7 @@ def _immediate_update(self, previous_state: bool):
current_timestamp = datetime.now().timestamp()

async def turn_off_automatically(now):
_LOGGER.info(f"Audio alert off | {self.name} @{now}")
_LOGGER.debug(f"Audio alert off | {self.name} @{now}")

self.entity_manager.set_mqtt_state(self.topic, self.event_type, False)

Expand All @@ -58,7 +58,7 @@ async def turn_off_automatically(now):
should_alert = False

if should_alert:
_LOGGER.info(f"Audio alert on, {message} | {self.name}")
_LOGGER.debug(f"Audio alert on, {message} | {self.name}")

self._last_alert = current_timestamp
super()._immediate_update(previous_state)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/blueiris/binary_sensors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def _immediate_update(self, previous_state: bool):

async def async_added_to_hass_local(self):
"""Subscribe MQTT events."""
_LOGGER.info(f"Added new {self.name}")
_LOGGER.debug(f"Added new {self.name}")
2 changes: 1 addition & 1 deletion custom_components/blueiris/binary_sensors/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def force_update(self):

async def async_added_to_hass_local(self):
"""Subscribe MQTT events."""
_LOGGER.info(f"Added new {self.name}")
_LOGGER.debug(f"Added new {self.name}")
_LOGGER.debug(
f"Subscribing to MQTT topics '{MQTT_ALL_TOPIC}', QOS: {DEFAULT_QOS}"
)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/blueiris/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def async_setup_entry(hass, config_entry, async_add_devices):


async def async_unload_entry(_hass, config_entry):
_LOGGER.info(f"async_unload_entry {CURRENT_DOMAIN}: {config_entry}")
_LOGGER.debug(f"async_unload_entry {CURRENT_DOMAIN}: {config_entry}")

return True

Expand Down Expand Up @@ -126,7 +126,7 @@ def _immediate_update(self, previous_state: bool):

async def async_added_to_hass_local(self):
"""Subscribe MQTT events."""
_LOGGER.info(f"Added new {self.name}")
_LOGGER.debug(f"Added new {self.name}")

@property
def supported_features(self) -> CameraEntityFeature:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/blueiris/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def async_step_init(self, user_input=None):
return await self.async_step_blue_iris_additional_settings(user_input)

async def async_step_blue_iris_additional_settings(self, user_input=None):
_LOGGER.info(f"Starting additional settings step: {user_input}")
_LOGGER.debug(f"Starting additional settings step: {user_input}")
errors = None

await self._config_flow.initialize(self.hass, self._config_entry)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/blueiris/managers/config_flow_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async def _update_entry(self):

await self._config_manager.update(entry)
except InvalidToken:
_LOGGER.info("Reset password")
_LOGGER.debug("Reset password")

del self._data[CONF_PASSWORD]

Expand Down
2 changes: 1 addition & 1 deletion custom_components/blueiris/managers/device_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def async_remove_entry(self, entry_id):
dr.async_clear_config_entry(entry_id)

async def delete_device(self, name):
_LOGGER.info(f"Deleting device {name}")
_LOGGER.debug(f"Deleting device {name}")

device = self._devices[name]

Expand Down
4 changes: 2 additions & 2 deletions custom_components/blueiris/managers/entity_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ async def _async_update(self):
restored = state.attributes.get("restored", False)

if restored:
_LOGGER.info(
_LOGGER.debug(
f"Entity {entity.name} restored | {entity_id}"
)

Expand All @@ -264,7 +264,7 @@ async def _async_update(self):
async_add_entities(entities_to_add, True)

if len(entities_to_delete) > 0:
_LOGGER.info(f"Following items will be deleted: {entities_to_delete}")
_LOGGER.debug(f"Following items will be deleted: {entities_to_delete}")

for domain in SIGNALS:
entities = dict(self.get_entities(domain))
Expand Down
12 changes: 6 additions & 6 deletions custom_components/blueiris/managers/home_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ async def async_update_entry(self, entry: ConfigEntry = None):
)

if not self._is_initialized:
_LOGGER.info(
_LOGGER.debug(
f"NOT INITIALIZED - Failed handling ConfigEntry change: {entry.as_dict()}"
)
return

_LOGGER.info(f"Handling ConfigEntry change: {entry.as_dict()}")
_LOGGER.debug(f"Handling ConfigEntry change: {entry.as_dict()}")

if update_config_manager:
await self._config_manager.update(entry)
Expand All @@ -164,7 +164,7 @@ async def async_update_entry(self, entry: ConfigEntry = None):
await self.storage_manager.async_save_to_store(data)

async def async_remove(self, entry: ConfigEntry):
_LOGGER.info(f"Removing current integration - {entry.title}")
_LOGGER.debug(f"Removing current integration - {entry.title}")

if self._remove_async_track_time is not None:
self._remove_async_track_time()
Expand All @@ -177,11 +177,11 @@ async def async_remove(self, entry: ConfigEntry):

await self._device_manager.async_remove()

_LOGGER.info(f"Current integration ({entry.title}) removed")
_LOGGER.debug(f"Current integration ({entry.title}) removed")

async def async_update(self, event_time):
if not self._is_initialized:
_LOGGER.info(f"NOT INITIALIZED - Failed updating @{event_time}")
_LOGGER.debug(f"NOT INITIALIZED - Failed updating @{event_time}")
return

try:
Expand Down Expand Up @@ -231,7 +231,7 @@ async def delete_entity(self, domain, name):

async def dispatch_all(self):
if not self._is_initialized:
_LOGGER.info("NOT INITIALIZED - Failed discovering components")
_LOGGER.debug("NOT INITIALIZED - Failed discovering components")
return

for domain in SUPPORTED_DOMAINS:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/blueiris/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def async_setup_entry(hass, config_entry, async_add_devices):


async def async_unload_entry(_hass, config_entry):
_LOGGER.info(f"async_unload_entry {CURRENT_DOMAIN}: {config_entry}")
_LOGGER.debug(f"async_unload_entry {CURRENT_DOMAIN}: {config_entry}")

return True

Expand Down Expand Up @@ -107,4 +107,4 @@ def _immediate_update(self, previous_state: bool):

async def async_added_to_hass_local(self):
"""Subscribe MQTT events."""
_LOGGER.info(f"Added new {self.name}")
_LOGGER.debug(f"Added new {self.name}")

0 comments on commit f6c9ca2

Please sign in to comment.