Class TimeslotPeakshaving

    • Constructor Detail

      • TimeslotPeakshaving

        public TimeslotPeakshaving()
    • Method Detail

      • isActiveDate

        protected static boolean isActiveDate​(java.time.LocalDate startDate,
                                              java.time.LocalDate endDate,
                                              java.time.LocalDateTime dateTime)
        This method returns true if the Current date is within configured StartDate and endDate.
        Parameters:
        startDate - the configured start date
        endDate - the configured end date
        dateTime - the date to be tested
        Returns:
        boolean values which specify the current date is within the configured date range
      • isActiveTime

        protected static boolean isActiveTime​(java.time.LocalTime startTime,
                                              java.time.LocalTime endTime,
                                              java.time.LocalDateTime dateTime)
        Is the time of 'dateTime' within startTime and endTime?.
        Parameters:
        startTime - the configured start time
        endTime - the configured end time
        dateTime - the time to be tested
        Returns:
        true if it is within startTime and endTime
      • convertDate

        protected static java.time.LocalDate convertDate​(java.lang.String date)
                                                  throws OpenemsException
        Converts a string to a LocalDate.
        Parameters:
        date - the date as a String
        Returns:
        the converted date
        Throws:
        OpenemsException
      • convertTime

        protected static java.time.LocalTime convertTime​(java.lang.String time)
                                                  throws OpenemsException
        Converts a string to a LocalTime.
        Parameters:
        time - the time as a string
        Returns:
        the converted time
        Throws:
        OpenemsException