コード例 #1
0
ファイル: ffEcobee.py プロジェクト: zpriddy/Firefly
 def register_ecobee_get_pin(self, args={}):
   url='https://api.ecobee.com/authorize?response_type=ecobeePin&client_id=' + str(self._api_key) + '&scope=smartWrite'
   response = requests.get(url).json()
   self._pin = response.get('ecobeePin')
   self._auth_code = response.get('code')
   ffNotify('all', 'Ecobee Auth Pin: ' + str(self._pin) + '. To finish installing ecobee, goto ecobee.com, login, from the menu on the right. Click Apps, Add App and enter Pin. After this is done you may preceed to the next step.')
   return str(self._pin)
コード例 #2
0
ファイル: location.py プロジェクト: zpriddy/Firefly
 def sunset_handler(self):
   ffNotify('ZachPushover', 'LOCATION: It is sunset!')
   ffEvent('location',{'time':'sunset'})
   now = self.now()
   sunset_time = self._city.sun(date=datetime.now(self._city.tz) + timedelta(days=1), local=True)['sunset']
   logging.debug("Sunset Time: " + str(sunset_time))
   delay_s = (sunset_time - now).total_seconds()
   l_scheduler.runInS(delay_s, self.sunset_handler, replace=True, uuid='SunsetScheduler')
コード例 #3
0
ファイル: location.py プロジェクト: zpriddy/Firefly
 def dusk_handler(self):
   ffNotify('ZachPushover', 'LOCATION: It is dusk!')
   ffEvent('location',{'time':'dusk'})
   now = self.now()
   dusk_time = self._city.sun(date=datetime.now(self._city.tz) + timedelta(days=1), local=True)['dusk']
   logging.debug("Dusk Time: " + str(dusk_time))
   delay_s = (dusk_time - now).total_seconds()
   l_scheduler.runInS(delay_s, self.dusk_handler, replace=True, uuid='DuskScheduler')
コード例 #4
0
ファイル: location.py プロジェクト: zpriddy/Firefly
 def noon_handler(self):
   ffNotify('ZachPushover', 'LOCATION: It is noon!')
   ffEvent('location',{'time':'noon'})
   now = self.now()
   noon_time = self._city.sun(date=datetime.now(self._city.tz) + timedelta(days=1), local=True)['noon']
   logging.debug("Noon Time: " + str(noon_time))
   delay_s = (noon_time - now).total_seconds()
   l_scheduler.runInS(delay_s, self.noon_handler, replace=True, uuid='NoonScheduler')
コード例 #5
0
ファイル: ffEcobee.py プロジェクト: RajeshPatadiya/Firefly-4
 def register_ecobee_get_pin(self, args={}):
     url = 'https://api.ecobee.com/authorize?response_type=ecobeePin&client_id=' + str(
         self._api_key) + '&scope=smartWrite'
     response = requests.get(url).json()
     self._pin = response.get('ecobeePin')
     self._auth_code = response.get('code')
     ffNotify(
         'all', 'Ecobee Auth Pin: ' + str(self._pin) +
         '. To finish installing ecobee, goto ecobee.com, login, from the menu on the right. Click Apps, Add App and enter Pin. After this is done you may preceed to the next step.'
     )
     return str(self._pin)
コード例 #6
0
ファイル: location.py プロジェクト: RajeshPatadiya/Firefly-4
 def dusk_handler(self):
     ffNotify('ZachPushover', 'LOCATION: It is dusk!')
     ffEvent('location', {'time': 'dusk'})
     now = self.now()
     dusk_time = self._city.sun(date=datetime.now(self._city.tz) +
                                timedelta(days=1),
                                local=True)['dusk']
     logging.debug("Dusk Time: " + str(dusk_time))
     delay_s = (dusk_time - now).total_seconds()
     l_scheduler.runInS(delay_s,
                        self.dusk_handler,
                        replace=True,
                        uuid='DuskScheduler')
コード例 #7
0
ファイル: location.py プロジェクト: RajeshPatadiya/Firefly-4
 def sunset_handler(self):
     ffNotify('ZachPushover', 'LOCATION: It is sunset!')
     ffEvent('location', {'time': 'sunset'})
     now = self.now()
     sunset_time = self._city.sun(date=datetime.now(self._city.tz) +
                                  timedelta(days=1),
                                  local=True)['sunset']
     logging.debug("Sunset Time: " + str(sunset_time))
     delay_s = (sunset_time - now).total_seconds()
     l_scheduler.runInS(delay_s,
                        self.sunset_handler,
                        replace=True,
                        uuid='SunsetScheduler')
コード例 #8
0
ファイル: location.py プロジェクト: RajeshPatadiya/Firefly-4
 def noon_handler(self):
     ffNotify('ZachPushover', 'LOCATION: It is noon!')
     ffEvent('location', {'time': 'noon'})
     now = self.now()
     noon_time = self._city.sun(date=datetime.now(self._city.tz) +
                                timedelta(days=1),
                                local=True)['noon']
     logging.debug("Noon Time: " + str(noon_time))
     delay_s = (noon_time - now).total_seconds()
     l_scheduler.runInS(delay_s,
                        self.noon_handler,
                        replace=True,
                        uuid='NoonScheduler')