Package com.diozero.devices
Class W1ThermSensor
- java.lang.Object
-
- com.diozero.devices.W1ThermSensor
-
- All Implemented Interfaces:
DeviceInterface
,SensorInterface
,ThermometerInterface
,AutoCloseable
public class W1ThermSensor extends Object implements ThermometerInterface
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
W1ThermSensor.Type
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close this devicestatic List<W1ThermSensor>
getAvailableSensors()
static List<W1ThermSensor>
getAvailableSensors(String folder)
String
getSerialNumber()
float
getTemperature()
Get temperature in degrees celsiusW1ThermSensor.Type
getType()
-
-
-
Method Detail
-
getAvailableSensors
public static List<W1ThermSensor> getAvailableSensors()
-
getAvailableSensors
public static List<W1ThermSensor> getAvailableSensors(String folder)
-
getTemperature
public float getTemperature() throws RuntimeIOException
Get temperature in degrees celsius- Specified by:
getTemperature
in interfaceThermometerInterface
- Returns:
- Temperature (deg C)
- Throws:
RuntimeIOException
- if an I/O error occurs
-
getType
public W1ThermSensor.Type getType()
-
getSerialNumber
public String getSerialNumber()
-
close
public void close()
Description copied from interface:DeviceInterface
Close this device- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDeviceInterface
-
-