All notable changes to this project will be documented in this file (since version 1.1.8).
If you notice that something is missing, please open an issue or submit a PR.
The format is based on Keep a Changelog.
- Speed up "get accessories". #418
- Increase minimum python version to 3.7. #417
- Speed up encryption by using ChaCha20Poly1305Reusable. #413
- Speed up serialization using orjson. #412
- Avoid redundant parsing of the URL. #402
- Allow invalid client values when enabled. #392
- Only send the latest state in case of multiple events for the same characteristic. #385
- Handle invalid formats from clients. #387
- Fix floating point values with minStep. #382
- Bump zeroconf to 0.36.2. #380
- Handle additional cases of invalid values. #378
- Allow passing the zeroconf server name when creating the AccessoryDriver. #379
- Increment the config version when the accessory changes. #376
- Add support for HAP v 1.1. #365
- Reduce event overhead. #360
- Ensure floating point values are truncated for int formats. #361
- Remove python 3.10 alpha from ci workflow. #362
- Protocol 1.1: Add support for prepared writes. #366
- Decrease snapshot timeout to avoid being disconnected. #367
- Avoid writing delayed camera snapshots when the connection is closed. #368
- Switch from ed25519 to pynacl. #355
- Bumped zeroconf to 0.32. #351
- Handle additional cases of invalid hostnames. #348
- Python 3.5 is no longer supported. #354
- Add async registration for zeroconf. #342
- Reduce payload sizes by adding support for short UUIDs and compact json (~40% reduction). #345
- Fix
run_at_intervalwith multiple accessories. #335 - Ensure HTTP 200 status is sent when there are no failures for
get_characteristics. Improves battery life. #337
- Python 3.10 support. #328
- Improve connection stability with large responses. #320
- Fix
Accessroy.runnot being awaited from a bridge. #323 - Clean up event subscriptions on client disconnect. #324
- Implement partial success response for
set_characteristics(wasBAD_REQUESTon error). #316
- Fix an issue that would cause pairing to fail (implement
list pairings). #307 - Remove unsupported characters from Accessory names. #310
- Speed up event subscription for new connections. #308
- Properly handle camera snapshots. #311
- Properly handle pairing attempt when already paired. #314
- HTTP server is now based on asyncio. #301
- Fix a bug in the pairing URL generator. #303
- Ensure an error response is generated on exception. #292
- Improve error reporting during pairing. #289
- Handle request for an empty read instead of throwing an exception. #288
- Fix thread safety in get characteristics. #287
- Support for multiple camera streams. #273
- Use SimpleQueue instead of Queue when available (performance improvements). #274
- Make sure accessory setup code appears when running under systemd. #276
- Improve event loop handling. #270
- Auto-detect the IP address in the camera demo so it can work out of the box. #268
- Correctly handling of a single byte read request. #267
- Add compatibility with zeroconf 0.27. #263
- Fix random disconnect after upgrade to encrypted. #253
- Convert the characteristic UUID to string only once. #256
- Fix pairing failure - split read/write encryption upgrade. #258
- Allow negotiated framerate to be used - add "-framerate" parameterto avfoundation. #260
- Add support for unavailable accessories. #252
### Developers
- Cleanup and fixes for python 3.7 and 3.8. Enable pylint in Travis. #255
- Fix race condition that causes pairing and unpairing failures. #246
- Fix loop on dropped connections that causes temporary stalls and connection loss. #249
- Fix exception on missing video fields. #245
- Fix exception caused by wrong parameter encoding to tlv.encode in camera.py. #243
- Log exceptions when handling a request in the HTTP server. #241
- Add an option to select the zeroconf broadcast interface. #239
- Allow service callbacks to handle multiple AIDs. #237
- Fix an issue where reading just one byte at the beginning of a block can crash the connection. #235
- Improve camera accessory integration. #231
- Add support for service-level callbacks. You can now register a callback that will be called for all characteristics that belong to it. #229
-
- Switch the symmetric cipher to use the cryptography module. This greatly improves performance. #232
- Example Accessory that exposes the raspberry pi GPIO pins as a relay. #220
- The HAP server is now HTTP version 1.1. #216
- Fixed an issue where accessories on the server can appear non-responsive. #216
- Correctly end HAP responses in some error cases. #217
- Fixed an issue where an accessory can appear as non-responsive after an event. Events for value updates will not be sent to the client that initiated them. #215
- The
AccessoryDrivercan now advertise on a different address than the one the server is running on. This is useful when pyhap is running behind a NAT. #203
- Added support for Television accessories.
- Fixed an issue where stopping the
AccessoryDrivercan fail withRuntimeError('dictionary changed size during iteration'). - Fixed an issue where the
HAPServercan crash when sending events to clients.
- Tests for
hap_server.
- Correctly proxy
_io_refsto the socket. #145
- Added a
asyncio.SafeChildWatcheras part ofAccessoryDriver.startif started in the main thread. - Added
Camera.stop, which terminates all streaming processes. AccessoryDriver.safe_modeparameter. Set withdriver.safe_mode = Truebeforedriver.startto disableupdate_advertisementcall forpairandunpair. After unpairing a restart is necessary. #168
- The default implementations of the
Camera'sstart_stream,stop_streamandreconfigure_streamare now async. - The streaming process is started with
asyncio.create_subprocess_execinstead ofsubprocess.Popen - Moved most of the metadata from
setup.pytosetup.cfg. Added long description.
AccessoryDriver.add_jobnow correctly schedules coroutines wrapped in functools.partial.- Fixed the slow shutdown in python 3.7, which was caused by the changed
behavior of
ThreadingMixIn.server_close. - Fixed an issue where sockets are blocked on
recvwhile inCLOSE_WAITstate, which can eventually exhausts the limit of open sockets. #145
- Added support for the camera accessory. #161
- Added a demo script that starts four fake accessories.
- Added
NeoPixelsLightStripaccessory. #144 - Added new Accessory categories. Commit
- Updated the README with information on how to setup a camera accessory.
- Spelling fix - executor (accessory_driver). #159
- Char.client_update_value now ignores call if value is already set. This could happen during automations. #162
- Updated README. #138
- Accessory return codes for characteristics. #143
- Deprecation notice in
accessory.py/config_changed. #150 - Add end_response in set_characteristics. #153
- Spelling mistake in
setup.cfgthat caused broken builds. #130
- Package data is now included again. #128
- Option to pass custom loader object to
driverwith parameterloader. #105 - Default port for
accessory_driver.port = 51234. #105
- The
loaderobject is now stored in thedriverand can be accessed throughdriver.loader. #105 - Use the
Accessory.run_at_intervaldecorator for therunmethod, instead ofwhile True: sleep(x); do_stuff(). #124
- The
driverdoesn't take the topaccessoryanymore. Instead it's added throughdriver.add_accessory()after the initialization. #105 - All
driverinit parameter are now required to be passed as keywords. #105 - Any
accessoryneeds thedriverobject for its initialization, passed as first argument. #105 - Removed class
AsyncAccessory. All of its methods are now fully integrated into theAccessoryclass.run,stopcan be either normal or async methods andrun_at_intervalworks with both as well. #124
- Removed
acc.set_driver()andacc.set_sentinel()methods.acc.run_sentinel,acc.aio_stop_eventandacc.loopare now accessed throughacc.driver.xxx.run_sentinelis changed tostop_event. #105 - Added scripts for
setupandrelease. #125 - Added
asynchelper methods and restructuredstartandstopmethods forasyncconversion. #124
- Added
getter_callbackto Characteristics. #90 - The
pincodecan now be assigned as a parameter for the driver. #120
- Improved documentation for version
2.0.0. #114
- The
accessoryandbridgeparametermacandpincodeare now deprecated. #120 Accessory.config_changed, usedriver.config_changedinstead. #120Accessory.paired, usedriver.state.pairedinstead. #120
- Typo in log message in
accessory_driver.stop. #112
- Moved all accessories from
pyhap.accessoriesto anaccessoriesfolder at the root of the project. #115 - Removed unused method
accessory.create. #117 - Removed
iid_managerandsetup_idparameter fromaccessoryandbridgeinitcalls. #117
- The
driverevent loop name changed fromevent_looptoloop. #107 pyhap.accessoriesis now a native namespace package. Seepyhap/accessories/README.mdfor details on how to integrate third party Accessories. #115- Added static code checks. To run them locally use
tox -e lintandtox -e pylint. #118 - Added
Statehelper class to keep track of (semi-)static information. #120 - Variables that are related to pairing and storing static information have been moved to
driver.state. That includes fromaccessory:config_version,mac,setup_id,private_key,public_keyandpaired_clientsas well as theadd_paired_clientandremoved_paired_clientmethods. Foraccessory_driver:addressandport. #120
- New helper methods to run the
runmethod repeatedly, until the driver is stopped.Accessory.repeat(time)orAsyncAccessory.repeat(time). #74 - New helper method
service.configure_char. Shortcut to configuring a characteristic. #84 - Characteristics and Services can now be created from a json dictionary with
from_dict. #85 - Added helper method to enable easy override of the
AccessoryInformationservice. #102 - Added helper method to load a service and chars and add it to an accessory. #102
- Accessory.run method is now called through an event loop. You can either inherit from
Accessorylike before: Therunmethod will be wrapped in a thread. Or inherit fromAsyncAccessoryand implementasync def run. This will lead to the execution in the event loop. #74 - Scripts are now located in a separate directory:
scripts. #81 driver.startstarts the event loop withloop.run_forever(). #83- Debug logs for
char.set_valueandchar.client_update_value. #99 - Changed default values associated with the
AccessoryInformationservice. #102 Accessory._set_servicesis now deprecated. Instead services should be initialized in the accessoriesinitmethod. #102
- Overriding properties now checks that value is still a valid value, otherwise value will be set to the default value. #82
- The
AccessoryInformationservice will always have theiid=1. #102
- With introduction of async methods the min required Python version changes to
3.5. #74 - The
Accessory.Categoryclass was removed and theCategoryconstants moved topyhap/const.pywith the naming:CATEGORY_[OLD_NAME](e.g.CATEGORY_OTHER) #86 - Updated
Accessoriesto work with changes. #74, #89 - Renamed
Accessory.brokertoAccessory.Driver.acc.set_brokeris nowacc.set_driver. #104 - QR Code is now optional. It requires
pip install HAP-python[QRCode]. #103 Loader.get_serv_loaderandLoader.get_char_loaderare replaced byLoader.get_loader, since it now handles loading chars and services in one class. #108
to_HAPmethods don't require theiid_managerany more #84, #85Service._add_charsis now integrated inService.add_characteristic85driver.update_advertismentis nowdriver.update_advertisement85TypeLoader,CharLoaderandServiceLoaderare now combined into theLoaderwith the new methodsget_charandget_serviceto load new chars and services. 85- Moved some constants to
pyhap/const.pyand removedHAP_FORMAT,HAP_UNITSandHAP_PERMISSIONSin favor forHAP_FORMAT_[OLD_FORMAT], etc. #86 - Updated tests and added new test dependency
pytest-timeout#88 - Rewrote
IIDManagerand splitIIDManager.removeintoremove_objandremove_iid. #100 requirements.txtfile has been added for min,requirements_all.txtcovers all requirements. #103
Characteristicsare now initialized with onlydisplay_name,type_idandpropertiesas parameter. Removedvalueandbroker. 73- Split
Characteristic.set_valuemethod intoset_valueandclient_update_value.set_valueis intended to send value updates to HomeKit, it won't call thesetter_callbackanymore.client_update_valueis now used by thedriverto update thevalueof the char accordingly and callsetter_callback. It will also notify any other clients about the value change. 73
- Removed
Characteristic.NotConfiguredError. 73 - Updated tests. 73
Characteristic.to_HAPdoesn't require theiid_managerany more. 73Characteristic.notifydoesn't check if broker is set anymore. 73- Added helper function
Characteristic._get_default_value. 73 - Added helper function
Characterisitc.to_valid_value. 73
- New method
Characteristic.override_properties. #66 - Added new
Apple-definedtypes. Please check the commit to see which have changed.
- Driver calls
char.set_valuenow withshould_notify=Trueinstead ofFalseto notify other clients about the value change as well. #62
- Accessories with
AID=7stopped working #61. Don't assign it to new accessories.
- Default value for
ValidValuesparameter is now thevalid valuewith the least value. Mostly0or1. #57 - Removed the deprecated method
char.get_value. #67 - Removed optional characteristics (
Service.opt_characteristics) from the service characterization. They have been handled similar toService.characteristicsinternally. They are still part ofpyhap/resources/services.jsonhowever. #67 - Updated the
Apple-definedtypes. Unsupported once have been removed. Please check the commit to see which have changed.
- Removed
Characteristic._create_hap_template()and merged it intoCharacteristic.to_HAP. #66 - Removed
char.has_valid_valuesand replaced it with runtime checks. #66 - Added a
requirements_all.txtfile. #65
No changelog for this version has been added yet.