benleb / ad-automoli

💡 Fully automatic light management based on conditions like motion, illuminance, humidity, and other clever features
https://github.com/benleb/ad-automoli
MIT License
110 stars 29 forks source link

Problem with Appdaemon Version 0.12.0 #114

Closed ALutz273 closed 1 year ago

ALutz273 commented 1 year ago

😩 Describe the issue/bug Ad-automoli not start after update Appdaemon to Version 0.12.0

https://github.com/hassio-addons/addon-appdaemon/releases/tag/v0.12.0

🎛️ Configuration

...
bad:
  module: automoli
  class: AutoMoLi
  room: Bad
  disable_switch_entities:
    - input_boolean.automoli
  delay: 240
  motion_state_on: "on"
  motion_state_off: "off"
  daytimes:
    - { starttime: "05:30", name: morning, light: 80 }
    - { starttime: "07:30", name: day, 100 }
    - { starttime: "20:30", name: evening, light: 20 }
    - { starttime: "22:00", name: night, light: 1 }
  illuminance:
    - sensor.badbewegungsmelder_illuminance
  illuminance_threshold: 25
  lights:
    - light.bad
  motion:
    - binary_sensor.badbewegungsmelder_iaszone
....

🧠 System

🗒️ Logs

2023-04-11 17:15:37.834743 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/ad-automoli/automoli.py
Looking in links: https://wheels.home-assistant.io/musllinux/
Collecting adutils>=0.6.2
  Downloading adutils-0.6.2-py3-none-any.whl (6.8 kB)
Installing collected packages: adutils
Successfully installed adutils-0.6.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
2023-04-11 17:15:41.353274 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/appdaemon_aqara_motion_sensors/aqara.py - ignoring
2023-04-11 17:15:41.353719 INFO AppDaemon: Loading app flur using class AutoMoLi from module automoli
2023-04-11 17:15:41.354854 INFO AppDaemon: Loading app bad using class AutoMoLi from module automoli
2023-04-11 17:15:41.355970 INFO AppDaemon: Loading app kueche using class AutoMoLi from module automoli
2023-04-11 17:15:41.357169 INFO AppDaemon: Loading app garderobe using class AutoMoLi from module automoli
2023-04-11 17:15:41.358224 INFO AppDaemon: Loading app ench using class EnCh from module ench
2023-04-11 17:15:41.359481 INFO AppDaemon: Calling initialize() for flur
2023-04-11 17:15:41.378555 WARNING flur: ------------------------------------------------------------
2023-04-11 17:15:41.378704 WARNING flur: Unexpected error in worker for App flur:
2023-04-11 17:15:41.378826 WARNING flur: Worker Ags: {}
2023-04-11 17:15:41.378947 WARNING flur: ------------------------------------------------------------
2023-04-11 17:15:41.385491 WARNING flur: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/app_management.py", line 160, in initialize_app
    await init()
  File "/config/appdaemon/apps/ad-automoli/automoli.py", line 402, in initialize
    daytimes = await self.build_daytimes(
  File "/config/appdaemon/apps/ad-automoli/automoli.py", line 1140, in build_daytimes
    await self.run_daily(
  File "/usr/lib/python3.10/site-packages/appdaemon/adapi.py", line 2661, in run_daily
    if event < now:
TypeError: can't compare offset-naive and offset-aware datetimes
2023-04-11 17:15:41.385639 WARNING flur: ------------------------------------------------------------
2023-04-11 17:15:41.385813 INFO AppDaemon: Calling initialize() for bad
2023-04-11 17:15:41.397578 WARNING bad: ------------------------------------------------------------
2023-04-11 17:15:41.397728 WARNING bad: Unexpected error in worker for App bad:
2023-04-11 17:15:41.397840 WARNING bad: Worker Ags: {}
2023-04-11 17:15:41.397955 WARNING bad: ------------------------------------------------------------
2023-04-11 17:15:41.398144 WARNING bad: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/app_management.py", line 160, in initialize_app
    await init()
  File "/config/appdaemon/apps/ad-automoli/automoli.py", line 402, in initialize
    daytimes = await self.build_daytimes(
  File "/config/appdaemon/apps/ad-automoli/automoli.py", line 1140, in build_daytimes
    await self.run_daily(
  File "/usr/lib/python3.10/site-packages/appdaemon/adapi.py", line 2661, in run_daily
    if event < now:
TypeError: can't compare offset-naive and offset-aware datetimes
2023-04-11 17:15:41.398254 WARNING bad: ------------------------------------------------------------

🧁 Additional context Add any other context about the problem here.

legovaer commented 1 year ago

You can easily fix this by modifying two lines of code: see #115

mon3y78 commented 1 year ago

it fixed!

ALutz273 commented 1 year ago

It also works for me with the patch! @legovaer thanks you

ChrisHaPunkt commented 1 year ago

Hi @benleb , can we have the referenced PR merged please :)

benleb commented 1 year ago

sorry, give me few hours 👍👍 will care for it after work 👍