Class TemperatureSensorImpl
java.lang.Object
io.github.zeroone3010.yahueapi.v2.TemperatureSensorImpl
- All Implemented Interfaces:
Device,TemperatureSensor
public class TemperatureSensorImpl extends Object implements TemperatureSensor
-
Constructor Summary
Constructors Constructor Description TemperatureSensorImpl(UUID id, String name, Supplier<Temperature> stateProvider) -
Method Summary
Modifier and Type Method Description BigDecimalgetDegreesCelsius()Returns the detected temperature in degrees Celsius.BigDecimalgetDegreesFahrenheit()Returns the detected temperature in degrees Fahrenheit.UUIDgetId()Returns the technical id of the device, as assigned by the Bridge.ZonedDateTimegetLastChanged()The last time the temperature was updated.StringgetName()Returns the name of the device, as set by the user.StringtoString()
-
Constructor Details
-
Method Details
-
getId
Description copied from interface:DeviceReturns the technical id of the device, as assigned by the Bridge. The id stays the same even if the device name is changed by the user.
-
getName
Description copied from interface:DeviceReturns the name of the device, as set by the user. -
getDegreesCelsius
Description copied from interface:TemperatureSensorReturns the detected temperature in degrees Celsius.- Specified by:
getDegreesCelsiusin interfaceTemperatureSensor- Returns:
- A
BigDecimalwith two decimal places, indicating the current temperature. May also returnnullif the sensor is disabled in the Hue app.
-
getDegreesFahrenheit
Description copied from interface:TemperatureSensorReturns the detected temperature in degrees Fahrenheit.- Specified by:
getDegreesFahrenheitin interfaceTemperatureSensor- Returns:
- A
BigDecimalwith two decimal places, indicating the current temperature. May also returnnullif the sensor is disabled in the Hue app.
-
getLastChanged
Description copied from interface:TemperatureSensorThe last time the temperature was updated.- Specified by:
getLastChangedin interfaceTemperatureSensor- Returns:
- Timestamp.
-
toString
-