Class AbstractDeviceStatistics

java.lang.Object
com.github.kaklakariada.fritzbox.model.homeautomation.AbstractDeviceStatistics
Direct Known Subclasses:
Energy, Humidity, Power, Temperature, Voltage

public abstract class AbstractDeviceStatistics extends Object
  • Constructor Details

    • AbstractDeviceStatistics

      public AbstractDeviceStatistics()
  • Method Details

    • getStatisticsByGrid

      public Optional<Statistics> getStatisticsByGrid(int grid)
      Supply the Statistics gathered for a chosen grid
      Parameters:
      grid - grid
      Returns:
      Optional - avoid NPE if no statistics present
    • getStats

      public abstract List<Statistics> getStats()
      All classes implementing this abstract class need to provide a "getStats"-method
      Returns:
      List
    • getStats

      protected List<Statistics> getStats(List<Statistics> stats, MeasurementUnit measurementUnit)
      AVM gathers just integer numbers. We know the precision only from documentation, it is never provided by returned responses from Fritz!Box. So we add this information here to the statistics.
      Parameters:
      stats - statistics to which to add the measurment unit
      measurementUnit - the unit to add to the statistics
      Returns:
      statistics with measurement units
    • statisticsToString

      protected abstract List<String> statisticsToString()
      All classes implementing this abstract class need to provide a "statisticsToString"-method
      Returns:
      List
    • statisticsToString

      protected List<String> statisticsToString(String type)
      Parameters:
      type - statistics type
      Returns:
      statistics as one line per grid