OutdoorStats.py 797 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. class OutdoorStats(object):
  4. Temperature = 20.0
  5. bWindy = False
  6. Pressure = 0.0
  7. Humidity = 0.0
  8. WindSpeed = 0.0
  9. WindDegree = 0
  10. Clouds = 0.0
  11. bRaining = False
  12. bSnowing = False
  13. MoonPhase = {
  14. "index" : 0,
  15. "phase" : 0,
  16. "pos" : 0,
  17. "name": ""
  18. }
  19. def getJson(self):
  20. return {
  21. "Temperature": self.Temperature,
  22. "bWindy": self.bWindy,
  23. "Pressure": self.Pressure,
  24. "Humidity": self.Humidity,
  25. "WindSpeed": self.WindSpeed,
  26. "WindDegree": self.WindDegree,
  27. "Clouds": self.Clouds,
  28. "bRaining": self.bRaining,
  29. "bSnowing": self.bSnowing,
  30. "Moon": self.MoonPhase
  31. }