コード例 #1
0
ファイル: appdaemon.py プロジェクト: beeaton/appdaemon
def check_time_constraint(args, name):
  unconstrained = True
  if "constrain_start_time" in args or "constrain_end_time" in args:
    if "constrain_start_time" not in args:
      start_time = "00:00:00"
    else:
      start_time = args["constrain_start_time"]
    if "constrain_end_time" not in args:
      end_time = "23:59:59"
    else:
      end_time = args["constrain_end_time"]
    if not ha.now_is_between(start_time, end_time, name):
      unconstrained = False

  return unconstrained
コード例 #2
0
ファイル: appapi.py プロジェクト: gunnarhelgason/appdaemon
 def now_is_between(self, start_time_str, end_time_str):
     return ha.now_is_between(start_time_str, end_time_str, self.name)