All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- The entire old
io.github.zeroone3010.yahueapi.Hue
class. Useio.github.zeroone3010.yahueapi.v2.Hue
instead. Not every method might yet be available with it yet, but most, anyway. With this, also the related classes, returned by the various method there, were removed; use the ones used by the newHue
class instead. - Support for HTTP. Only HTTPS is supported anymore. Should work both with the updated Bridges that have a Signify-signed certificate and the older Bridges that have a self-signed certificate. With this change certain constructors have been removed. The same ones should still be present without the protocol, so the migration guide is to just remove the offending parameter.
- Updated dependencies, most importantly okhttp-eventsource from 2.x.x to 4.x.x.
Hue#getBridgeIp()
method that returns the technical ID of the Bridge.- Made the
Color(float,float,float)
constructor public, no need to use the staticColor.of(float,float,float)
method anymore if you prefer not to.
addLight(Light)
andremoveLight(Light)
methods for theGroup
class.- Proper support for motion sensors in the new API version: they are now represented with a new
MotionSensor
interface that has anisMotion()
method for checking for motion, and agetLastChanged()
method for getting the last time the status was updated. - Support for temperature sensors in the new API version: the v2
Hue
object now has agetTemperatureSensors()
method. TheTemperatureSensor
can return the temperature both in degrees Celsius and Fahrenheit. - Support for Bridge certificates signed by the Signify CA. This may still cause issues with older Bridges that are still using self-signed certificates, so please check everything! The default setting in this library should be to use the "unverified HTTPS" option everywhere, as that works with the older self-signed certificates too.
- Support for scenes. Use the
getScenes()
andgetSceneByName(String)
methods in theGroup
objects. Call theactivate()
method of aScene
to activate it. - Support for the
prism
effect. - Documentation for version 3.0.0 into the README.md file. Docs for version 2 of the library can still be found from README_v2.md.
- Added default enum values to be used in case new effects or some such variables are introduced into the API. (Fixes #59)
- Support for events! Use the new
io.github.zeroone3010.yahueapi.v2.Hue
class and itssubscribeToEvents(HueEventListener)
method to get real time updates from the Bridge when something happens in the system.
- Removed UPNP from Bridge discovery methods, as Philips is deprecating it.
- Removed plain HTTP as a possible Bridge connection protocol, as Philips is deprecating it. With this removal
also removed the constructor from the
Hue
class that hadHueBridgeProtocol
as a parameter, as the enum now only has one value. Also changed said enum from public to package private.
getRooms()
,getZones()
,getRoomByName()
, andgetZoneByName()
methods from theio.github.zeroone3010.yahueapi.Hue
class in favor of the methods with the same names (if not the same signatures) in theio.github.zeroone3010.yahueapi.v2.Hue
class. Note that the deprecated methods returnCollection
s of objects, whereas the new methods returnMap
s, where the key is the unique id of the entity, and the value is the entity itself. Just call the.values()
method of such aMap
if you still want to iterate through all the values like before.
- A new method,
HueBridgeConnectionBuilder.isHueBridgeEndpoint()
, to test whether you are indeed trying to connect to a Hue bridge and not some other server by accident (contributed by @Kakifrucht) getId()
method forScene
objects, to get the technical ids of scenes.
- The
java.util.logging
based loggers have been scrapped in favor of SLF4J (contributed by @Kakifrucht)
- Added a way to search for new lights in the system: the
searchForNewLights()
method in theHue
class. It is accompanied by thegetNewLightsSearchStatus()
method, which, however, you do not need to use when searching for new lights, as the first method will resolve aFuture
with a collection of the new lights found, if any. - Added mDNS (multicast DNS) as a new Bridge discovery method. This will be used instead of UPNP which Philips will disable in the future.
- Added
Room.addLight(Light)
andRoom.removeLight(Light)
methods for adding and removing lights to and from rooms.
- Changed System.out.println commands into proper logger calls.
- Changed logger names into
io.github.zeroone3010.yahueapi
.
- Fixed a possible
NullPointerException
when querying temperature from a temperature sensor if the sensor is disabled in the app (now it just returnsnull
instead).
- Bridge connections are now using HTTPS by default, for the plain HTTP connections have been scheduled for deprecation by Philips. Note, however, that as many bridges still have self-signed certificates which cannot really be validated anyway, this means that by default all certificate validations will be turned off. If the Hue bridge is not the only system that your application talks to, you should consider whether this is an issue for you. Eventually Philips will update the bridges to use a Signify root certificate, after which sensible validation can be performed.
- Deprecated the UPnP bridge discovery method, for Philips has announced it has been scheduled to be disabled in Q2 2022.
- Deprecated plain HTTP as a communication protocol with the bridge, again due to Philips deprecating it too
getAllLights()
method for theHue
object, returning aRoom
object with all the lights that the Bridge knows about. This is a convenience method provided by the Hue API itself, and it allows you to easily toggle all the lights in the system at once.getMaxLumens()
method forLight
objects. With the recent addition of 1600 lumen bulbs into the Hue family, it seemed like a good idea to be able to differentiate the brighter lamps from the dimmer ones.getId()
method forLight
andRoom
objects. Requested by users, these methods may be needed for advanced use cases.
- Support for effects. Just like alerts, effects can be activated with the light
State
. The Hue API currently supports only one type of effect: the color loop. It cycles indefinitely through all the hues using the current brightness and saturation settings. The color loop effect can be activated with the.setState(State.COLOR_LOOP_EFFECT)
method of a light, and subsequently stopped with.setState(State.NO_EFFECTS)
. turnOn()
andturnOff()
methods for theRoom
interface, for toggling all the lights in a room or zone.
- More Javadoc documentation
- Fixed possible null pointer exceptions, should the Bridge ever return any collections (lights, sensors, etc) as
null
. This is probably not possible with the actual Hue Bridge, but there are emulator systems that may behave like this. - Handle unauthorized user error more gracefully, explaining the situation in the exception.
- Support for alerts. Alerts can be activated with the light
State
. There are two types of alerts currently supported by the Hue API: short alerts, i.e. one "breath cycle", and long alerts, where the light blinks for 15 seconds, or until the alert typeNONE
is issued. - More Javadoc documentation
- Fixed a
NullPointerException
when trying to read the daylight status from a daylight sensor that had not been configured. Now it will just returnfalse
and log a warning message when queried. The need to configure such a sensor has also been explained in the Javadoc of theDaylightSensorImpl
class.
This release contains several breaking changes. This means that if you have been using a previous version of this library, you may need to change your code to account for the changes in this version. See below for the details. Also, many thanks to everyone who contributed issues and pull requests!
- Support for other kinds of switches than just the Philips Hue dimmer switches.
getUnassignedLightByName(String)
method, to accompany thegetUnassignedLights()
method added in the previous release.- Added geofence support as presence sensors. They can be retrieved like all motion sensors with
getPresenceSensors()
orgetPresenceSensorByName(String)
with the name of a registered device. - Added ambient light sensor support.
- Support for Android, thanks to the removal of the dependency to the
java.awt.Color
class (see below).
- Changed how switches are handled: Philips Hue dimmer switches are no longer considered special in any way.
Instead, all switches are equal and can be accessed with the new
Switch
interface. TheHue
class now hasgetSwitches()
andgetSwitchByName(String)
methods instead of the oldgetDimmerSwitches()
andgetDimmerSwitchByName(String)
methods. LightType.ON_OFF
enum value was renamed toLightType.ON_OFF_LIGHT
to better distinguish it from theON_OFF_PLUGIN_UNIT
value.- Light color is to be set with the new
io.github.zeroone3010.yahueapi.Color
class. The class contains a multitude of factory methods, so that the transition from the oldjava.awt.Color
would be as easy as possible. This change was made to remove the dependency on thejava.awt
package, which is not available in the Android environment. - Motion sensors renamed to presence sensors to account for the addition of geofence sensors. This means that in the
Hue
classgetMotionSensors()
andgetMotionSensorByName(String)
methods have been renamed togetPresenceSensors()
andgetPresenceSensorByName(String)
respectively.
DimmerSwitch
,DimmerSwitchAction
,DimmerSwitchButton
, andDimmerSwitchButtonEvent
classes. These have basically been replaced with theSwitch
,SwitchEvent
,Button
, andButtonEvent
classes.- Setter methods accessible with the
getRaw()
method. Some of these were deprecated in v1.1.0 already.
- Support for Smart Plugs: they will appear in the API with the type
LightType.ON_OFF_PLUGIN_UNIT
- Support for lights that do not belong to any group or zone: accessible using the
getUnassignedLights()
of theHue
object
- Deprecate the
LightType.ON_OFF
enumeration value: this one will be renamed toON_OFF_LIGHT
in the future
- Fixed issue #15:
the
HueBridgeDiscoveryService
returnedHueBridge
objects with their name and IP address reversed
- Bridge discovery: possibility to find any Bridges in the current LAN. UPnP and N-UPnP methods supported.
- Resourcelinks, accessible with the
getRaw()
method - Scenes, accessible with the
getRaw()
method - Possibility to activate a scene for a room
- Other types of light groups besides just lights and zones are now supported too
setCaching(boolean)
method. This caches the Bridge state (i.e. light, sensor and room states) and stops querying the Bridge unless explicitly told to do that by using therefresh()
method, or until caching is disabled again.setBrightness(int)
method forRoom
objects.
- Support for zones
- Getter methods for certain properties accessible with the
getRaw()
method
- Certain setter methods accessible with the
getRaw()
method
- Initial release