Smarthome Functionen
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

helpers.py 393B

12345678910111213141516171819
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. import config
  5. import geo
  6. import inspect
  7. import time
  8. def now():
  9. return time.mktime(time.localtime())
  10. def sunrise_time(time_offs_min=30):
  11. return time.mktime(geo.sun.sunrise(config.GEO_POSITION)) + time_offs_min * 60
  12. def sunset_time(time_offs_min=-30):
  13. return time.mktime(geo.sun.sunset(config.GEO_POSITION)) + time_offs_min * 60