crowbarz / ha-pioneer_async

Home Assistant media_player component for Pioneer AVRs, rewritten in asyncio and supporting the UI config flow.
Apache License 2.0
29 stars 10 forks source link

'NoneType' object has no attribute 'get' - when changing Sound mode #25

Closed D-Jeffrey closed 1 year ago

D-Jeffrey commented 1 year ago

When trying to set the Sound mode I get the following: image

Running the current release 0.8

I can change the Source, but the error appears on Sound source. I think it worked in the previous release.

2023-04-08 20:34:03.165 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140087147918432] 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1820, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1857, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 216, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 977, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call
    await result
  File "/config/custom_components/pioneer_async/media_player.py", line 636, in async_select_sound_mode
    return await self._pioneer.set_listening_mode(sound_mode, self._zone)
  File "/usr/local/lib/python3.10/site-packages/aiopioneer/pioneer_avr.py", line 1370, in set_listening_mode
    if self.audio.get(zone).get("input_multichannel"):
AttributeError: 'NoneType' object has no attribute 'get'

Current Attribute state for the media player is:

sound_mode_list: STEREO, Front Stage Surround Advance, Front Stage Surround Advance Wide, AUTO SURR/STREAM DIRECT, AUTO SURROUND, DIRECT, PURE DIRECT, STEREO (direct), STANDARD, 2ch, PRO LOGIC, PRO LOGIC2 MOVIE, PRO LOGIC2 MUSIC, PRO LOGIC2 GAME, Neo:6 CINEMA, Neo:6 MUSIC, PRO LOGIC2x MOVIE, PRO LOGIC2x MUSIC, PRO LOGIC2x GAME, XM HD SURROUND, NEURAL SURROUND, PRO LOGIC2z HEIGHT, WIDE SURROUND MOVIE, WIDE SURROUND MUSIC, Neo:X CINEMA, Neo:X MUSIC, Neo:X GAME, NEURAL SURROUND+Neo:X CINEMA, NEURAL SURROUND+Neo:X MUSIC, NEURAL SURROUND+Neo:X GAME, PROLOGIC + THX CINEMA, PL2 MOVIE + THX CINEMA, Neo:6 CINEMA + THX CINEMA, PL2x MOVIE + THX CINEMA, THX SELECT2 GAMES, THX CINEMA, THX MUSIC, THX GAMES, PL2 MUSIC + THX MUSIC, PL2x MUSIC + THX MUSIC, Neo:6 MUSIC + THX MUSIC, PL2 GAME + THX GAMES, PL2x GAME + THX GAMES, THX ULTRA2 GAMES, PROLOGIC + THX MUSIC, PROLOGIC + THX GAMES, PL2z HEIGHT + THX CINEMA, PL2z HEIGHT + THX MUSIC, PL2z HEIGHT + THX GAMES, ACTION, SCI-FI, DRAMA, ENTERTAINMENT SHOW, MONO FILM, EXPANDED THEATER, CLASSICAL, UNPLUGGED, ROCK/POP, EXTENDED STEREO, PHONES SURROUND, TV SURROUND, SPORTS, ADVANCED GAME, Auto Level Control, OPTIMUM SURROUND, RETRIEVER AIR, ECO MODE, Neo:X CINEMA + THX CINEMA, Neo:X MUSIC + THX MUSIC, Neo:X GAME + THX GAMES, ECO MODE 1, ECO MODE 2
device_class: receiver
friendly_name: Pioneer AVR
supported_features: 69004
source_list: PHONO, CD, TUNER, CD-R/TAPE, Wii, TV/SAT, VIDEO 1, MULTI CH IN, VIDEO 2, DVR/BDR, iPod/USB, XM RADIO, CabIe, Computer, Amazon FireTV, HDMI 4, HDMI 5, Bluray, INTERNET RADIO, SIRIUS, ADAPTER PORT
volume_level: 0.4648648648648649
is_volume_muted: false
media_title: TV/SAT
source: TV/SAT
sound_mode: 
sources_json: {"PHONO": "00", "CD": "01", "TUNER": "02", "CD-R/TAPE": "03", "Wii": "04", "TV/SAT": "05", "VIDEO 1": "10", "MULTI CH IN": "12", "VIDEO 2": "14", "DVR/BDR": "15", "iPod/USB": "17", "XM RADIO": "18", "CabIe": "19", "Computer": "20", "Amazon FireTV": "21", "HDMI 4": "22", "HDMI 5": "23", "Bluray": "25", "INTERNET RADIO": "26", "SIRIUS": "27", "ADAPTER PORT": "33"}
device_volume: 86
device_max_volume: 185
device_volume_db: -37.5
amp: 
speakers: A
hdmi_audio: AMP
pqls: AUTO
panel_lock: 'OFF'
remote_lock: '0'
display: "\0              "

tuner: 
band: FM
frequency: 99.1
class: A
preset: 1

channel_levels: 
'1':
  C: 7
  L: 8.5
  R: 9
  SL: 9
  SR: 8.5
  SBL: 8.5
  SBR: 5.5
  SW: 1.5
  LH: 0
  RH: 0
  LW: 0
  RW: 0

dsp: 
mcacc_memory_set: 1
phase_control: 'off'
virtual_sb: true
virtual_height: true

video: 
signal_input_terminal: VIDEO
signal_input_resolution: '---'
signal_input_aspect: '---'
signal_input_color_format: '---'
signal_input_bit: '---'
signal_input_extended_colorspace: '---'
signal_output_resolution: '---'
signal_output_aspect: '---'
signal_output_color_format: '---'
signal_output_bit: '---'
signal_output_extended_colorspace: '---'
signal_hdmi1_recommended_resolution: '---'
signal_hdmi1_deepcolor: 36bit (12bit*3)
signal_hdmi2_recommended_resolution: '---'
signal_hdmi2_deepcolor: '---'
pantherale0 commented 1 year ago

Will be fixed in next version - https://github.com/crowbarz/aiopioneer/pull/24

crowbarz commented 1 year ago

Fixed in 0.8.1.