ekmmeters.py
def assignSchedule(self, schedule, period, hour, minute, tariff):
        """ Assign one schedule tariff period to meter bufffer.

        Args:
            schedule (int): A :class:`~ekmmeters.Schedules` value or in range(Extents.Schedules).
            tariff (int): :class:`~ekmmeters.Tariffs` value or in range(Extents.Tariffs).
            hour (int): Hour from 0-23.
            minute (int): Minute from 0-59.
            tariff (int): Rate value.

        Returns:
            bool: True on completed assignment.
        """
        if ((schedule not in range(Extents.Schedules)) or
                (period not in range(Extents.Tariffs)) or
                (hour < 0) or (hour > 23) or (minute < 0) or
                (minute > 59) or (tariff < 0)):
            ekm_log("Out of bounds in Schedule_" + str(schedule + 1))
            return False

        period += 1
        idx_min = "Min_" + str(period)
        idx_hour = "Hour_" + str(period)
        idx_rate = "Tariff_" + str(period)
        if idx_min not in self.m_schedule_params:
            ekm_log("Incorrect index: " + idx_min)
            return False
        if idx_hour not in self.m_schedule_params:
            ekm_log("Incorrect index: " + idx_hour)
            return False
        if idx_rate not in self.m_schedule_params:
            ekm_log("Incorrect index: " + idx_rate)
            return False

        self.m_schedule_params[idx_rate] = tariff
        self.m_schedule_params[idx_hour] = hour
        self.m_schedule_params[idx_min] = minute
        self.m_schedule_params['Schedule'] = schedule
        return True
def assignSchedule(self, schedule, period, hour, minute, tariff):
        """ Assign one schedule tariff period to meter bufffer.

        Args:
            schedule (int): A :class:`~ekmmeters.Schedules` value or in range(Extents.Schedules).
            tariff (int): :class:`~ekmmeters.Tariffs` value or in range(Extents.Tariffs).
            hour (int): Hour from 0-23.
            minute (int): Minute from 0-59.
            tariff (int): Rate value.

        Returns:
            bool: True on completed assignment.
        """
        if ((schedule not in range(Extents.Schedules)) or
                (period not in range(Extents.Tariffs)) or
                (hour < 0) or (hour > 23) or (minute < 0) or
                (minute > 59) or (tariff < 0)):
            ekm_log("Out of bounds in Schedule_" + str(schedule + 1))
            return False

        period += 1
        idx_min = "Min_" + str(period)
        idx_hour = "Hour_" + str(period)
        idx_rate = "Tariff_" + str(period)
        if idx_min not in self.m_schedule_params:
            ekm_log("Incorrect index: " + idx_min)
            return False
        if idx_hour not in self.m_schedule_params:
            ekm_log("Incorrect index: " + idx_hour)
            return False
        if idx_rate not in self.m_schedule_params:
            ekm_log("Incorrect index: " + idx_rate)
            return False

        self.m_schedule_params[idx_rate] = tariff
        self.m_schedule_params[idx_hour] = hour
        self.m_schedule_params[idx_min] = minute
        self.m_schedule_params['Schedule'] = schedule
        return True
def assignSchedule ( self , schedule , period , hour , minute , tariff ) : if ( ( schedule not in range ( Extents . Schedules ) ) or ( period not in range ( Extents . Tariffs ) ) or ( hour < 0 ) or ( hour > 23 ) or ( minute < 0 ) or ( minute > 59 ) or ( tariff < 0 ) ) : ekm_log ( "Out of bounds in Schedule_" + str ( schedule + 1 ) ) return False period += 1 idx_min = "Min_" + str ( period ) idx_hour = "Hour_" + str ( period ) idx_rate = "Tariff_" + str ( period ) if idx_min not in self . m_schedule_params : ekm_log ( "Incorrect index: " + idx_min ) return False if idx_hour not in self . m_schedule_params : ekm_log ( "Incorrect index: " + idx_hour ) return False if idx_rate not in self . m_schedule_params : ekm_log ( "Incorrect index: " + idx_rate ) return False self . m_schedule_params [ idx_rate ] = tariff self . m_schedule_params [ idx_hour ] = hour self . m_schedule_params [ idx_min ] = minute self . m_schedule_params [ 'Schedule' ] = schedule return True
Assign one schedule tariff period to meter bufffer.

        Args:
            schedule (int): A :class:`~ekmmeters.Schedules` value or in range(Extents.Schedules).
            tariff (int): :class:`~ekmmeters.Tariffs` value or in range(Extents.Tariffs).
            hour (int): Hour from 0-23.
            minute (int): Minute from 0-59.
            tariff (int): Rate value.

        Returns:
            bool: True on completed assignment.
Assign one schedule tariff period to meter bufffer .