code: def check_and_log_activation_change(self):
          
          now = int(time.time())
  
          was_active = self.is_active
          self.is_active = self.is_time_valid(now)
  
          # If we got a change, log it!
          if self.is_active != was_active:
              _from = 0
              _to = 0
              # If it's the start, get a special value for was
              if not self.activated_once:
                  _from = -1
                  self.activated_once = True
              if was_active:
                  _from = 1
              if self.is_active:
                  _to = 1
  
              # Now raise the log
              brok = make_monitoring_log(
                  'info', 'TIMEPERIOD TRANSITION: %s;%d;%d' % (self.get_name(), _from, _to)
              )
              return brok
          return None
docs: Will look for active/un-active change of timeperiod.
          In case it change, we log it like:
          [1327392000] TIMEPERIOD TRANSITION: <name>;<from>;<to>
  
          States of is_active:
          -1: default value when start
          0: when timeperiod end
          1: when timeperiod start
  
          :return: None or a brok if TP changed