Releases: crowbarz/aiopioneer
0.8.2rc1
What's Changed
- Exception handling has been overhauled:
- More granular exception classes have been added as subclasses of PioneerError class
- AVR errors for connection and update methods raise PioneerError subclasses when an AVR error is encountered.
mute_on
,mute_off
,set_volume_level
now raises PioneerError subclasses for AVR errors, previously errors were only loggedupdate
raises an ExceptionGroup when multiple exceptions are encountered during a full refreshupdate
raisesAVRUnavailableError
is raised when the AVR disconnects during a full refreshsend_command
always raisesAVRUnavailableError
on AVR disconnect, even whenignore_error
is set- Error text interpolation is moved into the PioneerError class
- The responder task has been removed and its functionality merged into the listener task. The responder debug parameter has also been removed
- AVR properties are reset to unknown on AVR disconnect. A full update after reconnection will repopulate AVR properties
All Changes
- Run full update on AVR on reconnect 1f9150b
- Reset AVR properties on disconnect 52c236c
- Drop listening modes message to debug e58c5a0
- Read responses directly in listener task instead of responder task 28e5d44
- Remove responder task handling 28e5d44
- Remove responder debug 28e5d44
- Add failed command to timeout exception 688a34e
- Show debug for command queue start and complete 0f29d52
- Add AVRConnectError exception for connect errors 28445c9
- Demote AVR not connected on disconnect message to debug be2f5c6
- Log error on send_raw_command write exception be2f5c6
- Always re-raise AVRUnavailableError on send_command f869cfd
- Defer exception handling to caller in _refresh_zones ccd196e
- Handle command queue task cancellation and AVR unavailable exceptions 1d4a9b2
- Re-raise command queue exceptions on command queue wait 2b54ffe
- Pass through exceptions on set_volume_level command failure a4792e8
- Raise AVRCommandError on volume step errors a4792e8
- Pass through exceptions for mute_off and mute_on 0a0f53d
- Revert to asyncio.wait_for to wait for response 9596d8f
- Move error message interpolation to .exceptions 45ce64c
- Raise PioneerError child exceptions for detected AVR errors 45ce64c
- Add more granular errors with keyed message text and exception argument parsing 45ce64c
- Handle command queue task cancellation in _command_queue_wait 45ce64c
- Don't raise ExceptionGroup if only one exception occurred executing command queue 45ce64c
- Fix single zone refresh in update 8f58d2f
- Fix response queue typing 5ed1ef4
- Move AVRCommandError zone argument to end to match kwargs ef62487
Full Changelog: 0.8.1...0.8.2rc1
0.8.1
What's Changed
The query_device_model
method now returns True
if a device model was returned by the AVR, False
if the AVR returned an error code, and None
if the AVR command timed out. This return value can be used to more reliably determine if the device speaks the Pioneer AVR API, even when the device model query command is not supported.
All Changes
- Handle error response when querying device model dbb7d8f
- Check zone arguments are of type Zone c20a82d
- Update test_api for API 0.8.0 be49dac
- Use isinstance instead of type 97513c6
Full Changelog: 0.8.0...0.8.1
0.8.0
TL;DR
Access to params and properties have changed in this release due to the main class being split up. All AVR updates are now scheduled via the command queue. The order of queries sent during AVR zone refresh have changed order. Some unused methods have been removed. The Zones
enum and the param
module have been renamed to Zone
and params
respectively.
Breaking Changes
- To enable params to be accessible from AVR response parsers and also to reduce the size of the main class, the
PioneerAVR
class has been split out to the classes listed below. References to parameter and properties methods and attributes will need to be updated to be accessed via theparams
andproperties
attributes of thePioneerAVR
object. All other public attributes have moved to the new classes.PioneerAVRParams
contains the user and run-time parameter get/set methods. Some method names have changed, please consult the updated documentation for detailsPioneerAVRProperties
contains the cache of AVR properties collected from its responsesPioneerAVRConnection
contains the connection related methods, althoughPioneerAVR
inherits from the new class so the connection methods are still accessible via thePioneerAVR
class
- Commands that are sent to the AVR to perform full updates are now executed via the command queue. This eliminates the previous interaction between the updater and command queue threads, as the updater now simply schedules updates via the command queue
- The order of queries during a full update has been modified so that amp, DSP and tone queries are executed before video queries
- The
Zones
enum has been renamedZone
for improved consistency - The
param
module has been renamedparams
for improved consistency - Exception handling within the AVR interface methods has been made more robust. The AVR listener and responders will now only trigger disconnection from the AVR (and reconnection if requested) if the AVR connection drops. Notably, parser exceptions and timeouts to power, volume and mute queries will no longer cause the AVR connection to disconnect and reconnect. This should fully resolve issues such as crowbarz/ha-pioneer_async#54
- Not detecting Zone 1 on the AVR on module startup has been demoted from an error to a warning and Zone 1 is assumed to exist. Despite this change, most AVR commands will still not work when the AVR is in this state. It is now up to the client to check that Zone 1 has been discovered and handle the case when it is not
- The
source
AVR zone property has been renamedsource_id
, and an additionalsource_name
property has been introduced that contains the mapped name for the source for each zone - The
query_device_model
method has been introduced to query the device model and set default model parameters. Previously, thequery_device_info
queried all device information including the device model regardless of whether the AVR main zone was powered on. Clients that previously calledquery_device_info
at module startup should now callquery_device_model
.query_device_info
will be automatically called when the main zone is powered on for the first time after connecting, and no longer needs to be called by the client - If Zone 1 is not powered on at integration startup, queries for AVR device info is deferred until Zone 1 is first powered on.
- The
query_audio_information
andquery_video_information
commands have been renamedquery_basic_audio_information
andquery_basic_video_information
. These basic query commands, in addition toquery_listening_mode
, are executed with a delay after all zone power and source operations whenever any zone is powered on - The
system_query_source_name
has been renamed toquery_source_name
to avoid being sent during AVR device info queries - The
query_sources
method has been removed.PioneerAVRParams.get_runtime_param(PARAM_QUERY_SOURCES)
should be used instead - The
update_zones
method has been removed. Change the AVR zones by recreating thePioneerAVR
object with the new zones - The
PioneerAVR.initial_update
property has moved to run-time paramPARAM_ZONES_INITIAL_REFRESH
and is now a set ofZone
. ThePioneerAVRParams.zones_initial_refresh
property is provided as a convenience to access this run-time parameter - System parameters have been re-termed as run-time parameters to better reflect their function
- The
PioneerAVRProperties.zones
property now has typingset[Zone]
Major Changes
- Split connection, params and properties into separate classes by @crowbarz in #42
- Rename command system_query_source_name to query_source_name by @crowbarz in #43
- Simplify device info query by @crowbarz in #44
- Optimise AVR query command order by @crowbarz in #45
- Separate params and AVR properties into separate instantiated classes by @crowbarz in #46
- Update via command queue by @crowbarz in #47
- Rename zones class by @crowbarz in #48
- Rename module param to params by @crowbarz in #49
All Changes
- Update Makefile to use modern packaging 4f06af0
- Split connection, params and properties into separate classes #42
- Split out connection, properties, param classes
- Complete docstring
- Black
- Yield to cancelled tasks on disconnect
- Add more debug logs to _connection_listener
- Rename command system_query_source_name to query_source_name 67a99b0 #43
- Correct CLI module path in pyproject.toml 872352f
- Simplify device info query #44
- Separate initial AVR model query to query_device_model method
- Update CLI to use query_device_model on initial connect
- Always execute query_device_info on initial zone refresh
- Consolidate AVR methods fb6c529
- set_channel_levels optimisations 2bd26b9
- Consolidate param operations in param module 2c7bc3f
- Convert param retrieval functions to property 2c7bc3f
- Catch exceptions in command queue 0bf50c3
- Defer updates after command queue flushed 0bf50c3
- Optimise AVR query command order #45
- Group audio/video information queries to new function
basic
(audio
is now empty) - Modify query order to proritise audio over video, and move
tuner
,system
anddisplay
to end - Refresh zone before querying device info
- Don't queue basic query after each update
- Group audio/video information queries to new function
- Add names to asyncio tasks 191edaf
- Check for exceptions whenever checking that a task is done 266e040
- Move model property to PioneerAVRProperties 981f55b
- Break up long string f02e247
- Separate params and AVR properties into separate instantiated classes #46
- Update via command queue #47
- Execute zone refreshes via command queue b69bdcb
- Refactor update method and updater task to queue full refresh via command queue b69bdcb
- Schedule command queue task when queueing commands b69bdcb
- Query device info from refresh_zones after initial update, instead of queuing local command in parse_response b69bdcb
- Don't refresh zones after querying zones b69bdcb
- Rely on task.result() to re-raise exceptions in safe_wait_for b69bdcb
- Removed unused update_zones b69bdcb
- Add command queue debug param b69bdcb
- Overhauled and simplified debug b69bdcb
- Use repr to show exception name and details b69bdcb
- Fix source name/ID property mapping ddb8265
- Fix IP control port base property name 4e7c0c4
- Document IP control port base property 98bac5c
- Fix set_system_param proto b400b5c
- Move response parsing to parsers module b55210f
- Migrate response overrides for initial full refresh, query basic and volume bounce to parsers and local commands b55210f
- Pass full PioneerAVRParams object to parsers (allows setting of parameters) b55210f701cb10e52...
0.7.1
What's Changed
- Correct select_listening_mode and select_source method type hints 0de88ba
- Add reference to 2015 Pioneer command list 953de75
- Fix UnboundLocalError by @webmeister in #37
- Added VIDEO and GAME source IDs to source list by @dondonini in #38
- Updated deprecated asyncio.TimeoutError 6d2fbbc
- Fix minor typos db7219d
- Migrate setup.py to pyproject.toml f1544bf
- Explicitly pass command_name to local_command 554bde2
- Renamed zone update to refresh 7c12d70
- Track initial refresh for individual zones 7c12d70
- Support update of specific zone 7c12d70
- Always start updater task c58cf91
- Simplify zone discovery e2760f5
- Add AV information query command a079d4e
- Change update terminology to refresh a079d4e
- Add command queue debug to default debug level a079d4e
- Simplify update_zone logic by @webmeister in #39
New Contributors
- @webmeister made their first contribution in #37
- @dondonini made their first contribution in #38
Full Changelog: 0.7.0...0.7.1
0.7.0
What's Changed
select_listening_mode
now accepts argumentsmode_name
ormode_id
(requires one argument)select_source
now accepts argumentssource
orsource_id
(requires one argument)
Breaking Changes
- The
listening_mode
argument ofselect _listening_mode
has been renamed tomode_name
- Most PioneerAVR methods now raise exceptions derived from
PioneerError
when an error is encountered, rather than returningfalse
,None
or similar error value. Some instances that currently raiseValueError
orSystemError
will also raisePioneerError
subclasses in the near future send_raw_request
no longer accepts an argumentignore_error
and will always raise exceptions on error. Useignore_error
withsend_command
to have exceptions handled for you- asyncio yields have been optimised and minimised, which may cause certain sequences of operations to happen in a different order
All Changes
- Update class methods to throw exceptions on error ef2c580
- Rationalise
asyncio.sleep(0)
calls ac872ff - Fix frequency step error, fixes crowbarz/ha-pioneer_async#43 758cde0
- Raise
PioneerError
subclasses instead of returning None/False to flag errors in send_raw_request and _wait_for_response a6a29d4 - Remove ignore_error argument in send_raw_request and _wait_for_response a6a29d4
- Handle ignore_error in send_command by catching exceptions a6a29d4
- Refactor send_raw_request to use send_command a6a29d4
- Raise RuntimeError instead of SystemError 940a8cb
- Rename Pioneer exception classes to *Error a84d5bf
- Fix AVRCommandError class rename 06986f8
- Perform initial update only on Zone 1 power on 0b6b536
- Fix enum comparisons 80c8248
- Fix zone enum inequality comparisons de0d008
0.6.0
What's Changed
Warning
Please check out the Breaking Changes below if you use the Python API.
Tuner
- Support setting tuner frequency directly ff2161d 252bcef
- Fix frequency stepping when setting directly not supported 252bcef bbe1f66 bbe1f66 bbe1f66 252bcef
- Query and update tuner frequency before updating preset 55ae49d 273b9d9 9277b97 252bcef a3699ee
- Invalidate cached preset when frequency changes dcf5a15 4991314
- Check band argument in
select_tuner_band
0f75e4b - Add
tuner_previous_preset
andtuner_next_preset
commands 8455983 - Add
select_tuner_band
,tuner_next_preset
andtuner_previous_preset
methods 4359b7c bd05c51
Status polling
- Defer initial update if AVR Zone 1 is off on startup 4409e9a 4ad2caa 4409e9a 12593ec 88a9050
- Optimise queries on update 3d1baa2 565e5c5 b6b1c31 4409e9a
- Fix query commands supporting multiple zones not being executed on zone 1 34329d3
- Trigger update of
Zones.ALL
on power and input source changes 0c24787 - Refactor command queue processing and introduce local commands fa1a6b9 273b9d9 2fd6698 32470bd 32470bd 12593ec b852624
- Don't skip update if updates are locked 156c4b7
- Expose
command_queue_schedule
method 85eb6c5
Response parsing
- Restructured parsers functions and classes 8c657cd 8c657cd 32470bd
- Changed tuner response parser default zone to match commands dcf5a15
- Remove tabs and newlines from display 0f74481
- Include last character of display information 92ec860
- Decode correct bytes for signal_input_resolution 92ec860
- Fix video signal_input_resolution property parsing 575ad90
Miscellaneous
- Update Main Zone terminology to Zone 1 368b7d6
- Return command response for
turn_on
,turn_off
andset_source_name
methods
dd31842 - Abort on any command failure for
set_*_settings
dd31842 - Reorder task cancellation on disconnect to avoid stale tasks af75081
- Refactor
set_tone_settings
method 5edfb6b - Add
SOURCE_TUNER
constant for detecting tuner source 797a2bf - Return immutable dict in get_source_dict b66c732
- Use
copy.deepcopy
to return dict copy instead of merge a6b17ee - Use
StrEnum
for enums 9a785fb - Update
test_api.py
for recent aiopioneer changes 6f77c26 - Disable power on volume bounce and video queries for VSX-930 by default 80431d9 85d0161
- Simplify zone checking for
set_video_settings
andset_dsp_settings
80c73c7 - Misc comment updates 80c73c7
- Fix zone argument type for
_update_zone
andset_volume_level
0f75e4b - Ensure
send_command
optional arguments not specified positionally 7f64441 - Clarified method docstrings 7f64441
- Add function prototype for init and use
DEFAULT_TIMEOUT
andDEFAULT_SCAN_INTERVAL
db32e5e - get_param returns None for non-existent parameters edfdbd9
⚠️ Breaking Changes
- Python requirement bumped to 3.11 for StrEnum d986f2f
Zones
enum now used on all methods accepting zone arguments (except in params) f6131b4 dd31842- Zone argument removed from tuner methods as tuner is independent of zone dcf5a15
TunerBand
enum now used to specify a tuner band dcf5a15update
now waits for the update to finish by default 156c4b7 ddc39a9set_tuner_preset
renamed toselect_tuner_preset
012e571- Response codes marked
---
now return None 81d5869 - Dimmer mode, tone mode and dB strings have been updated 5edfb6b bdc590a
- Reordered
send_command
suffix argument 7f64441 - Rename
get_zone_listening_modes
->get_listening_modes
80c73c7 - Remove zone from
tuner_*
,get_listening_modes
,set_panel_lock
,set_remote_lock
andset_dimmer
methods c45055b - Rename
set_listening_mode
->select_listening_mode
4c7626b
0.6.0rc1
⚠️ Release Candidate 1
aiopioneer
0.6.0 will be a major upgrade that complements the upcoming release of the pioneer_async
Home Assistant integration. This release candidate enables the pioneer_async
release candidate to be installed on Home Assistant.
Please check out the Breaking Changes below if you use the Python API.
What's Changed
Tuner
- Support setting tuner frequency directly ff2161d 252bcef
- Fix frequency stepping when setting directly not supported 252bcef bbe1f66 bbe1f66 bbe1f66 252bcef
- Query and update tuner frequency before updating preset 55ae49d 273b9d9 9277b97 252bcef a3699ee
- Invalidate cached preset when frequency changes dcf5a15 4991314
- Check band argument in
select_tuner_band
0f75e4b - Add
tuner_previous_preset
andtuner_next_preset
commands 8455983 - Add
select_tuner_band
,tuner_next_preset
andtuner_previous_preset
methods 4359b7c bd05c51
Status polling
- Defer initial update if AVR Zone 1 is off on startup 4409e9a 4ad2caa 4409e9a 12593ec 88a9050
- Optimise queries on update 3d1baa2 565e5c5 b6b1c31 4409e9a
- Fix query commands supporting multiple zones not being executed on zone 1 34329d3
- Trigger update of
Zones.ALL
on power and input source changes 0c24787 - Refactor command queue processing and introduce local commands fa1a6b9 273b9d9 2fd6698 32470bd 32470bd 12593ec b852624
- Don't skip update if updates are locked 156c4b7
- Expose
command_queue_schedule
method 85eb6c5
Response parsing
- Restructured parsers functions and classes 8c657cd 8c657cd 32470bd
- Changed tuner response parser default zone to match commands dcf5a15
- Remove tabs and newlines from display 0f74481
- Include last character of display information 92ec860
- Decode correct bytes for signal_input_resolution 92ec860
- Fix video signal_input_resolution property parsing 575ad90
Miscellaneous
- Update Main Zone terminology to Zone 1 368b7d6
- Return command response for
turn_on
,turn_off
andset_source_name
methods
dd31842 - Abort on any command failure for
set_*_settings
dd31842 - Reorder task cancellation on disconnect to avoid stale tasks af75081
- Refactor
set_tone_settings
method 5edfb6b - Add
SOURCE_TUNER
constant for detecting tuner source 797a2bf - Return immutable dict in get_source_dict b66c732
- Use
copy.deepcopy
to return dict copy instead of merge a6b17ee - Use
StrEnum
for enums 9a785fb - Update
test_api.py
for recent aiopioneer changes 6f77c26 - Disable power on volume bounce and video queries for VSX-930 by default 80431d9 85d0161
- Simplify zone checking for
set_video_settings
andset_dsp_settings
80c73c7 - Misc comment updates 80c73c7
- Fix zone argument type for
_update_zone
andset_volume_level
0f75e4b - Ensure
send_command
optional arguments not specified positionally 7f64441 - Clarified method docstrings 7f64441
- Add function prototype for init and use
DEFAULT_TIMEOUT
andDEFAULT_SCAN_INTERVAL
db32e5e - get_param returns None for non-existent parameters edfdbd9
⚠️ Breaking Changes
- Python requirement bumped to 3.11 for StrEnum d986f2f
Zones
enum now used on all methods accepting zone arguments (except in params) f6131b4 dd31842- Zone argument removed from tuner methods as tuner is independent of zone dcf5a15
TunerBand
enum now used to specify a tuner band dcf5a15update
now waits for the update to finish by default 156c4b7 ddc39a9set_tuner_preset
renamed toselect_tuner_preset
012e571- Response codes marked
---
now return None 81d5869 - Dimmer mode, tone mode and dB strings have been updated 5edfb6b bdc590a
- Reordered
send_command
suffix argument 7f64441 - Rename
get_zone_listening_modes
->get_listening_modes
80c73c7 - Remove zone from
tuner_*
,get_listening_modes
,set_panel_lock
,set_remote_lock
andset_dimmer
methods c45055b - Rename
set_listening_mode
->select_listening_mode
4c7626b
0.5.0
What's Changed
- Add
extra_amplifier_listening_modes
to allow specifying set of listening modes supported by an AVR or AVR model dfc07f8 - Update available listening mode defaults for VS-930 b48142a
- Cache
listening_mode_raw
ID and expose as attribute dfc07f8 - Make listening mode names unique aa54e96
- Consolidate common
PARAM_DISABLED_LISTENING_MODES
andPARAM_SPEAKER_SYSTEM_MODES
configurations 4b666ce - Remove flags byte from amp display attribute 521cced
- Query display information on power or input change 79df438
- Call all zone callbacks on update to Zones.ALL 95133d5
- Always override calculated PARAM_TUNER_AM_FREQ_STEP if specified by user be32935
Breaking Changes
- Rename
get_sound_modes
toget_zone_listening_modes
to reflect AVR terminology. dfc07f8 - Rename
disable_autoquery
todisable_auto_query
d2b3c41 amplifier_speaker_system_modes
anddisabled_amplifier_listening_modes
were shortened toamp_speaker_system_modes
anddisabled_amp_listening_modes
respectively. d2b3c41
Full Changelog: 0.4.3...0.5.0
0.4.3
- Start queueing responses before sending command request. Fixes issue of command responses being occasionally missed by the responder due to a race condition 4a31041
- Implement
set_tuner_band
for setting the frequency band only 7d9ac4a - Refactor
set_tuner_frequency
and_calculate_am_frequency_step
7d9ac4a - Move
PARAM_TUNER_AM_FREQ_STEP
to system param to avoid its removal on param update 7d9ac4a - Implement
_command_queue_wait
to wait until command queue has finished executing. Wait for queue to be flushed before building source dict, and also after setting tuner band as this may trigger_calculate_am_frequency_step
7d9ac4a
Full Changelog: 0.4.2...0.4.3
0.4.2
What's Changed
- Rename set_input_name command to set_source_name ac4a9d5
- Support callback function for property update functions ff7a189
- Accept Zones in callback functions db86c6d
- Store PARAM_QUERY_SOURCES and pass to parsers 180b03c 79edcb6 1453918
- Add Zones.ALL by @11harveyj in #25
- Support suffix when sending commands via CLI ae12375
Full Changelog: 0.4.1...0.4.2