Package io.github.zeroone3010.yahueapi
Class AmbientLightSensorImpl
java.lang.Object
io.github.zeroone3010.yahueapi.AmbientLightSensorImpl
- All Implemented Interfaces:
AmbientLightSensor,Sensor
public class AmbientLightSensorImpl extends Object implements AmbientLightSensor
-
Field Summary
Fields Modifier and Type Field Description protected URLbaseUrlprotected Stringidprotected Stringnameprotected StringproductNameprotected SensorTypetype -
Method Summary
Modifier and Type Method Description StringgetId()Returns the id of the sensor, as assigned by the Bridge.ZonedDateTimegetLastUpdated()Returns the last time the sensor status has been updated, or null if it has not been updated.intgetLightLevel()Returns the current light level in lux.StringgetName()Returns the human readable name of the sensor as set by the user, e.g.StringgetProductName()Returns the human readable name of the sensor product, e.g.SensorTypegetType()Returns the type of the sensor.booleanisDark()Tells whether the current light level is below darkness threshold.booleanisDaylight()Tells whether the current light level is above light threshold.protected <T> TreadStateValue(String stateValueKey, Class<T> type)StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.zeroone3010.yahueapi.Sensor
getId, getLastUpdated, getName, getProductName, getType
-
Field Details
-
Method Details
-
toString
-
getLightLevel
public int getLightLevel()Description copied from interface:AmbientLightSensorReturns the current light level in lux.- Specified by:
getLightLevelin interfaceAmbientLightSensor- Returns:
- A
intindicating the current light level in lux.
-
isDaylight
public boolean isDaylight()Description copied from interface:AmbientLightSensorTells whether the current light level is above light threshold.- Specified by:
isDaylightin interfaceAmbientLightSensor- Returns:
trueif above light threshold,falseif not.
-
isDark
public boolean isDark()Description copied from interface:AmbientLightSensorTells whether the current light level is below darkness threshold.- Specified by:
isDarkin interfaceAmbientLightSensor- Returns:
trueif below darkness threshold,falseif not.
-
getName
Description copied from interface:SensorReturns the human readable name of the sensor as set by the user, e.g. "Living room switch". -
getProductName
Description copied from interface:SensorReturns the human readable name of the sensor product, e.g. "Hue motion sensor" or "Hue tap switch".- Specified by:
getProductNamein interfaceSensor- Returns:
- Name of the sensor product. May be null.
-
getId
Description copied from interface:SensorReturns the id of the sensor, as assigned by the Bridge. -
getType
Description copied from interface:SensorReturns the type of the sensor. -
getLastUpdated
Description copied from interface:SensorReturns the last time the sensor status has been updated, or null if it has not been updated.- Specified by:
getLastUpdatedin interfaceSensor- Returns:
- The time when the sensor status was last updated, or null.
-
readStateValue
-