All notable changes to this project will be documented in this file. See commit-and-tag-version for commit guidelines.
5.0.0 (2023-11-15)
-
Device:
Device#startPolling
,Device#stopPolling
, and Device/Bulb/Plug eventpolling-error
have been removed. -
Requires minimum node version v16
-
Requires minimum node version v14
-
drop support for node < v14 (348401a)
- Bulb: add Bulb#blink method (#162) (a8dd13d)
- catch more invalid discovery messages (#154) (935d3f3)
- Device: remove startPolling, stopPolling, that were previously deprecated (#157) (513deca)
- exported type fixes (fd336b2)
4.2.0 (2022-02-14)
- Client: add devicesUseDiscoveryPort to DiscoveryOptions (#139) (245dcd8), closes plasticrake/homebridge-tplink-smarthome#244 plasticrake/homebridge-tplink-smarthome#250
4.1.0 (2022-02-03)
- Bulb: add lightstate-sysinfo events (6b844a1)
4.0.0 (2022-02-02)
- Bulb: removed previously deprecated
getColorTemperatureRange
. UsecolorTemperatureRange
instead. - apiModules is now non-static property
- require minimum node version v12.20.0
- Bulb: removed deprecated getColorTemperatureRange (3dd442b)
- add color temp ranges for additional models (#137) (48eb046)
- Plug: add support for light strips such as KL430 (874a431), closes #130 #90
- change static property apiModules to non-static (6a171aa)
- Bulb: add getLightDetails (#135) (705392f), closes #92
-
cli
TypeError: Found non-callable @[@iterator](https://github.com/iterator)
(#125) (3e53050), closes #124 -
dimmer.setGentle*Time incorrectly named parameter (db9993f), closes #129
-
keep socket timer going until close emitted (416ce38), closes #108
-
upgrade commander (1911aa4)
3.3.0 (2021-03-01)
- change emeter#realtime type to RealtimeNormalized (1645215)
- Plug: add dimmer.brightness property (47f28f7)
- Plug: emit brightness-change & brightness-update (3fb2897)
- mark startPolling as deprecated (cc658ec)
3.2.1 (2021-02-28)
- rename
getColorTemperatureRange
tocolorTemperatureRange
(e3664d2)
3.2.0 (2021-02-28)
- add EventEmitter types (db259e9)
- export types Realtime, RealtimeV1, RealtimeV2 (f5f020f)
- use standard-version (#121) (e3a6cca)
- CLI: add
--broadcast
option tosearch
command
- Export types:
BulbSysinfo
,PlugSysinfo
,PlugConstructorOptions
Bulb
/Plug
#getInfo
now defaults to TCP transport unless specifically overridden in the call to#getInfo
.- Some newer devices and firmware would crash and reset when sent
emeter:{get_realtime:{}}
over UDP.
- Some newer devices and firmware would crash and reset when sent
Client
#startDiscovery
no longer queries energy usage (emeter:{get_realtime:{}}
)- Some newer devices and firmware would crash and reset when sent
emeter:{get_realtime:{}}
- Some newer devices and firmware would crash and reset when sent
Client
#send
returns a string instead of an object- removed
#getCommonDevice
Device
- Cannot be instantiated directly. Use
Client
ornew Bulb()
ornew Plug()
;
- Cannot be instantiated directly. Use
Bulb
/Plug
sysInfo
is now required to be passed in the constructor.
Bulb
#getColorTemperatureRange
now returnsnull
instead ofundefined
when the bulb does not support color temperature.
Plug
#relayState
changed to better reflect state of plugs with children. If device supports childId, but childId is not set, then it will return true if any child hasstate === 1
.
ResponseError
- properties
response
andcommand
are now strings instead of objects. - property
errorModules
was renamed tomodules
.
- properties
- Export
Bulb
,Device
,Plug
- Drop support for Node.js versions older than v10
Device
/Bulb
/Plug
- add
useSharedSocket
andsharedSocketTimeout
tosendOptions
- add
#closeConnection
function
- add
-
Client
startDiscovery
now queries emeter realtime information and devices may emitemeter-realtime-update
if supported
-
Client
/Device
/Bulb
/Plug
- rewrote and improved TCP/UDP networking code
-
Device
/Bulb
/Plug
- change
defaultSendOptions
to default toClient
defaultSendOptions
startPoller
now emitspolling-error
(#60)
- change
Plug
- add
supportsDimmer
property, returns true if dimmable plug (HS220) - add
dimmer
functionsdimmer.setBrightness
dimmer.getDefaultBehavior
dimmer.getDimmerParameters
dimmer.setDimmerTransition
dimmer.setDoubleClickAction
dimmer.setFadeOffTime
dimmer.setFadeOnTime
dimmer.setGentleOffTime
dimmer.setGentleOnTime
dimmer.setLongPressAction
dimmer.setSwitchState
- add
Plug
schedule
- add
dimmer
parameter toaddRule
- add
dimmer
parameter toeditRule
- add
Client
excludedMacAddresses
parameter added tostartDiscovery
filterCallback
parameter added tostartDiscovery
startDiscovery
parametersmacAddresses
andexcludedMacAddress
now support GLOB style patterns with?
and*
Device
/Bulb
/Plug
sendCommand
ResponseError
thrown bysendCommand
now includes:command
: command sent to deviceerrorModules
: array of modules that returned with errors.
- add
id
property. ReturnsdeviceId
orchildId
if childId is set. alias
returns child alias if childId is setdefaultSendOptions.timeout
default changed to 10000 ms from 5000 ms
Client
breakoutChildren
parameter added tostartDiscovery
defaultSendOptions.timeout
default changed to 10000 ms from 5000 ms
Plug
constructor
- change default
inUseThreshold
from0
to0.1
. Even with nothing plugged into some outlets and relay turned off they may report a small power draw.
- change default
Device
/Bulb
/Plug
sendCommand
- BREAKING CHANGE: Add childId parameter that will add
"context":{child_ids:[]}
to the command. This is to support plugs with multiple outlets.
- BREAKING CHANGE: Add childId parameter that will add
- Plug#getInfo and Emeter#realtime for devices without energy monitoring (Regression introduced in 0.23.0)
- Requires minimum Node version 6.4
Bulb
/Plug
getEmeterRealtime
will now simultaneously return both the new and old API style responses, i.e.current
andcurrent_ma
.
- Change
Bulb#getInfo()
to requestsystem: { get_sysinfo }
instead ofsmartlife.iot.common.system: { get_sysInfo }
Device#macNormalized
- Basic automated testing of CLI
- Changed TCP response handling to timeout when device responds but does not close connection
- CLI: Fixed reboot, reset, setLocation commands that expect integer arguments
- Reject instead of incorrectly throwing error for network errors
- new name,
hs100-api
is nowtplink-smarthome-api
Device
/Bulb
/Plug
- Many methods were moved to mirror the TPLink API.
- Example:
Plug#getScheduleRules()
is nowPlug.schedule#getRules()
- Example:
Bulb#getCloudInfo()
is nowBulb.cloud#getInfo()
- See API documentation for details.
- Example:
- Many methods were moved to mirror the TPLink API.
Device
/Bulb
/Plug
- Dozens of new methods, see documentation for details.
options
added as last argument to functions that send commandsoptions.timeout
andoptions.transport
can be set to customize the timeout and transport (tcp, udp) used for a single command
defaultSendOptions
added to constructor
Client
send
/sendCommand
- Receiving large TCP responses split across multiple segments are now supported
- Support UDP in addition to TCP
- UDP can be unreliable, also large replies may not be sent back from the device
ResponseError
now exported so consumer can check errors withinstanceof
Plug
#addTimerRule
#editTimerRule
#deleteAllTimerRules
Client#startDiscovery
now emitsdiscovery-invalid
when receiving an invalid response (perhaps from a non-tplink device)
encrypt
andencryptWithHeader
now work properly with non-ascii characters
- plasticrake/homebridge-hs100#35: Switch to utf8 from ascii to support special characters in Alias (thanks @wzaatar)
Device#name
re-added as alias forDevice#alias
for backwards compatibilityClient.startDiscovery
has additional parametermacAddresses
- if specified only devices matching MAC will be found
Bulb
#supportsBrightness
#supportsColor
#supportsColorTemperature
#getColorTemperatureRange
- #18
#togglePowerState
(thanks @adamsandle!)
Plug
- #18
#togglePowerState
(thanks @adamsandle!)
- #18
Client#getGeneralDevice
is nowClient#getCommonDevice
Device#name
is nowDevice#alias
Device#type
is nowDevice#deviceType
Device#getConsumption()
is nowDevice#getEmeterRealtime()
supportsConsumption
is nowsupportsEmeter
consumption-update
is nowemeter-realtime-update
- Existing
Device
/Bulb
/Plug
events have changed to no longer emit withthis
as argument
- Support for older Node 4.8
Bulb#getInfo()
added to mirrorPlug#getInfo()
- New
Bulb
events:lightstate-on
,lightstate-off
,lightstate-change
,lightstate-update
- Updated examples