Class AbstractDeviceStatistics
java.lang.Object
com.github.kaklakariada.fritzbox.model.homeautomation.AbstractDeviceStatistics
- Direct Known Subclasses:
Energy,Humidity,Power,Temperature,Voltage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetStatisticsByGrid(int grid) Supply the Statistics gathered for a chosen gridabstract List<Statistics>getStats()All classes implementing this abstract class need to provide a "getStats"-methodprotected List<Statistics>getStats(List<Statistics> stats, MeasurementUnit measurementUnit) AVM gathers just integer numbers.All classes implementing this abstract class need to provide a "statisticsToString"-methodstatisticsToString(String type)
-
Constructor Details
-
AbstractDeviceStatistics
public AbstractDeviceStatistics()
-
-
Method Details
-
getStatisticsByGrid
Supply the Statistics gathered for a chosen grid- Parameters:
grid- grid- Returns:
- Optional - avoid NPE if no statistics present
-
getStats
All classes implementing this abstract class need to provide a "getStats"-method- Returns:
- List
-
getStats
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 unitmeasurementUnit- the unit to add to the statistics- Returns:
- statistics with measurement units
-
statisticsToString
All classes implementing this abstract class need to provide a "statisticsToString"-method- Returns:
- List
-
statisticsToString
- Parameters:
type- statistics type- Returns:
- statistics as one line per grid
-