Skip to content

Commit

Permalink
fix: fixed which dir room_light_monitor saves to
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Jan 5, 2025
1 parent 9b06bbe commit dbcf052
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions home/.bin/room_light_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
# - Linux: Uses xprintidle for idle detection and notify-send for notifications
# - macOS: Uses ioreg for idle detection and osascript for notifications
#

import argparse
import logging
import platform
import subprocess
import time
from datetime import datetime
Expand All @@ -31,7 +34,9 @@

class RoomLightMonitor:
def __init__(self, verbose=False):
self.image_dir = Path("room_images")
# get cache dir
cache_dir = Path.home() / ".cache" / "room_light_monitor"
self.image_dir = cache_dir / "images"
self.image_dir.mkdir(exist_ok=True)
self.verbose = verbose
self.cap = None
Expand All @@ -58,7 +63,6 @@ def get_time_period(self):

def get_idle_time(self):
"""Get system idle time in milliseconds"""
import platform

system = platform.system()
try:
Expand Down Expand Up @@ -157,7 +161,6 @@ def capture_and_analyze(self):

def send_notification(self, summary, body):
"""Send desktop notification"""
import platform

system = platform.system()
try:
Expand Down Expand Up @@ -224,8 +227,6 @@ def run(self):


if __name__ == "__main__":
import argparse

parser = argparse.ArgumentParser(description="Monitor room light levels")
parser.add_argument(
"-v", "--verbose", action="store_true", help="Enable verbose output"
Expand Down

0 comments on commit dbcf052

Please sign in to comment.