From e659629c71e580be2aa7fccf2bb60dba58d9bdc9 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sat, 25 Nov 2023 21:19:59 -0600 Subject: [PATCH] logging tweaks --- motion.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/motion.py b/motion.py index f0db5e4..1685824 100644 --- a/motion.py +++ b/motion.py @@ -69,7 +69,7 @@ class Motion(Hass): async def callback_light_on(self, entity=None, attribute=None, old=None, new=None, kwargs=None): """Called when the light turns on """ - self.log('Light on callback') + self.log(f'{entity} turned on') # need this one to finish before continuing to the next line await self.cancel_motion_callback(new='on') self.listen_motion_off(await self.app.off_duration()) @@ -78,7 +78,7 @@ class Motion(Hass): async def callback_light_off(self, entity=None, attribute=None, old=None, new=None, kwargs=None): """Called when the light turns off """ - self.log('Light off callback') + self.log(f'{entity} turned off') # need this one to finish before continuing to the next line await self.cancel_motion_callback(new='off') self.listen_motion_on() @@ -111,4 +111,4 @@ class Motion(Hass): # self.log(f'{handle}: {info["entity"]}: {info["kwargs"]}') if new_match is not None and new_match.group("new") == new: await self.cancel_listen_state(handle) - self.log(f'cancelled: {await self.friendly_name(entity)}: {new}') + self.log(f'cancelled {new} callback for sensor {await self.friendly_name(entity)}')