|
@@ -22,8 +22,6 @@ except ImportError:
|
22
|
22
|
ROOT_LOGGER_NAME = 'root'
|
23
|
23
|
logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
|
24
|
24
|
|
25
|
|
-geo_position = geo.gps.coordinate(lat=49.976596, lon=9.1481443)
|
26
|
|
-
|
27
|
25
|
|
28
|
26
|
class pi_face(object):
|
29
|
27
|
LOG_PREFIX = 'PiFace:'
|
|
@@ -237,10 +235,10 @@ class state_machine_day_state(state_machine.state_machine):
|
237
|
235
|
return time.mktime(time.struct_time(tm))
|
238
|
236
|
|
239
|
237
|
def sunrise_time():
|
240
|
|
- return time.mktime(geo.sun.sunrise(geo_position)) + 30 * 60
|
|
238
|
+ return time.mktime(geo.sun.sunrise(config.GEO_POSITION)) + 30 * 60
|
241
|
239
|
|
242
|
240
|
def sunset_time():
|
243
|
|
- return time.mktime(geo.sun.sunset(geo_position)) - 30 * 60
|
|
241
|
+ return time.mktime(geo.sun.sunset(config.GEO_POSITION)) - 30 * 60
|
244
|
242
|
|
245
|
243
|
def sleep_time():
|
246
|
244
|
tm = time.localtime()
|
|
@@ -286,7 +284,7 @@ class state_machine_day_state(state_machine.state_machine):
|
286
|
284
|
return not self.sm_mode.this_state_is(self.sm_mode.STATE_AUTOMATIC)
|
287
|
285
|
|
288
|
286
|
def report_sunset_sunrise(self):
|
289
|
|
- state_machine.logger.debug('Sunrise: %s - Sunset: %s;', time.strftime("%H:%M", geo.sun.sunrise(geo_position)), time.strftime("%H:%M", geo.sun.sunset(geo_position))
|
|
287
|
+ state_machine.logger.debug('Sunrise: %s - Sunset: %s;', time.strftime("%H:%M", geo.sun.sunrise(config.GEO_POSITION)), time.strftime("%H:%M", geo.sun.sunset(config.GEO_POSITION))
|
290
|
288
|
)
|
291
|
289
|
|
292
|
290
|
|
|
@@ -479,10 +477,10 @@ class leyk(object):
|
479
|
477
|
return time.mktime(time.struct_time(tm))
|
480
|
478
|
|
481
|
479
|
def sunrise_time(self):
|
482
|
|
- return time.mktime(geo.sun.sunrise(geo_position)) + 30 * 60
|
|
480
|
+ return time.mktime(geo.sun.sunrise(config.GEO_POSITION)) + 30 * 60
|
483
|
481
|
|
484
|
482
|
def sunset_time(self):
|
485
|
|
- return time.mktime(geo.sun.sunset(geo_position)) - 30 * 60
|
|
483
|
+ return time.mktime(geo.sun.sunset(config.GEO_POSITION)) - 30 * 60
|
486
|
484
|
|
487
|
485
|
def sleep_time(self):
|
488
|
486
|
tm = time.localtime()
|