mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-28 17:56:21 +02:00
Fix suntimes working if mqtt is enabled but suntimes is disabled
This commit is contained in:
parent
bdf43fd522
commit
3fa274e342
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ class SunsetHandler:
|
|||
logging.info (f'Woke up...')
|
||||
|
||||
def sun_status2mqtt(self, dtu_ser, dtu_name):
|
||||
if not mqtt_client:
|
||||
if not mqtt_client or not self.suntimes:
|
||||
return
|
||||
local_sunrise = self.suntimes.riselocal(datetime.now()).strftime("%d.%m.%YT%H:%M")
|
||||
local_sunset = self.suntimes.setlocal(datetime.now()).strftime("%d.%m.%YT%H:%M")
|
||||
|
|
Loading…
Add table
Reference in a new issue