import appdaemon.plugins.hass.hassapi as hass
from datetime import datetime
class AzureStorage(hass.Hass):
def initialize(self):
self.run_every(self.backuptoazure, datetime.datetime.now(), 2*60)
def backuptoazure(self):
self.log("---BACUP TO AZURE---")
local_path = "/backup"
onlyfiles = [f for f in listdir(local_path) if isfile(join(local_path, f))]
for file in onlyfiles:
self.log("Uploading to Azure Storage as blob:\n\t" + file)
The script fails and I don’t know why. I’ve tried many different things … but can’t manage it to work.