Class SensorApi
- java.lang.Object
-
- com.inhousegreenhouse.ch.backend.model.api.Api
-
- com.inhousegreenhouse.ch.backend.model.api.SensorApi
-
public class SensorApi extends Api
SensorApi is a class that handles all requests to the Sensor API.
-
-
Constructor Summary
Constructors Constructor Description SensorApi(java.lang.String proxyUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ISensor<? extends java.lang.Number>>
getSensors(Greenhouse greenhouse, ADC adc)
Get all sensors from the API.void
recordData(ISensor<? extends java.lang.Number> sensor, Greenhouse greenhouse)
-
Methods inherited from class com.inhousegreenhouse.ch.backend.model.api.Api
getBaseUrl, sendRequest
-
-
-
-
Method Detail
-
getSensors
public java.util.List<ISensor<? extends java.lang.Number>> getSensors(Greenhouse greenhouse, ADC adc) throws ProxyRequestFailException
Get all sensors from the API.- Parameters:
greenhouse
- The greenhouse where the sensor are attached to.adc
- The AdC to use to read the sensor.- Returns:
- List of all sensors.
- Throws:
ProxyRequestFailException
- If the request fails.
-
recordData
public void recordData(ISensor<? extends java.lang.Number> sensor, Greenhouse greenhouse) throws ProxyRequestFailException, SpiCannotBeInitializedException
-
-