Class AmbientLightSensorImpl

java.lang.Object
io.github.zeroone3010.yahueapi.AmbientLightSensorImpl
All Implemented Interfaces:
AmbientLightSensor, Sensor

public class AmbientLightSensorImpl
extends Object
implements AmbientLightSensor
  • Field Details

  • Method Details

    • toString

      public String toString()
    • getLightLevel

      public int getLightLevel()
      Description copied from interface: AmbientLightSensor
      Returns the current light level in lux.
      Specified by:
      getLightLevel in interface AmbientLightSensor
      Returns:
      A int indicating the current light level in lux.
    • isDaylight

      public boolean isDaylight()
      Description copied from interface: AmbientLightSensor
      Tells whether the current light level is above light threshold.
      Specified by:
      isDaylight in interface AmbientLightSensor
      Returns:
      true if above light threshold, false if not.
    • isDark

      public boolean isDark()
      Description copied from interface: AmbientLightSensor
      Tells whether the current light level is below darkness threshold.
      Specified by:
      isDark in interface AmbientLightSensor
      Returns:
      true if below darkness threshold, false if not.
    • getName

      public String getName()
      Description copied from interface: Sensor
      Returns the human readable name of the sensor as set by the user, e.g. "Living room switch".
      Specified by:
      getName in interface Sensor
      Returns:
      Name of the sensor.
    • getProductName

      public String getProductName()
      Description copied from interface: Sensor
      Returns the human readable name of the sensor product, e.g. "Hue motion sensor" or "Hue tap switch".
      Specified by:
      getProductName in interface Sensor
      Returns:
      Name of the sensor product. May be null.
    • getId

      public String getId()
      Description copied from interface: Sensor
      Returns the id of the sensor, as assigned by the Bridge.
      Specified by:
      getId in interface Sensor
      Returns:
      The sensor id.
    • getType

      public SensorType getType()
      Description copied from interface: Sensor
      Returns the type of the sensor.
      Specified by:
      getType in interface Sensor
      Returns:
      The type of the sensor as a SensorType enumeration value.
    • getLastUpdated

      public ZonedDateTime getLastUpdated()
      Description copied from interface: Sensor
      Returns the last time the sensor status has been updated, or null if it has not been updated.
      Specified by:
      getLastUpdated in interface Sensor
      Returns:
      The time when the sensor status was last updated, or null.
    • readStateValue

      protected <T> T readStateValue​(String stateValueKey, Class<T> type)