Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

climate_temp_data: 'NoneType' object has no attribute 'get' in 3.0.0 Beta 2 #116

Closed
ismarslomic opened this issue Feb 2, 2024 · 3 comments

Comments

@ismarslomic
Copy link
Collaborator

ismarslomic commented Feb 2, 2024

Just upgraded to 3.0.0 Beta 2 and the integration fails at initiation/setup with following error.
Installed on HA2024.1.6.
I got Jaguar iPace Y21.

Diagnostic file: #117

This error originated from a custom integration.

Logger: custom_components.jlrincontrol.coordinator
Source: helpers/update_coordinator.py:300
Integration: Jaguar Landrover InControl (documentation)
First occurred: 19:04:50 (6 occurrences)
Last logged: 19:07:33

Unexpected error fetching jlrincontrol (jlrincontrol-xxx@xxx) data: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/jlrincontrol/coordinator.py", line 517, in async_update_data
    await self.async_get_vehicle_status(vehicle)
  File "/config/custom_components/jlrincontrol/coordinator.py", line 404, in async_get_vehicle_status
    temp = int(float(climate_temp_data.get("value", "42"))) / 2
                     ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

@ismarslomic
Copy link
Collaborator Author

As workaround i hardcoded temp=21 and successfully managed to initialise the integration. I guess we should put and if-statement to check whether climate_temp_data is None before calling the get() function. Leaving this to you @msp1974 , but let me know if you need my assistance.

@ismarslomic ismarslomic changed the title climate_temp_data: 'NoneType' object has no attribute 'get' (3.0.0 Beta 2 ) climate_temp_data: 'NoneType' object has no attribute 'get' in 3.0.0 Beta 2 Feb 2, 2024
msp1974 added a commit that referenced this issue Feb 2, 2024
… 'NoneType' object has no attribute 'get' in 3.0.0 Beta 2 #116
@msp1974
Copy link
Owner

msp1974 commented Feb 2, 2024

Yes, seems EVs do not have this. Added an exception catch to prevent this error. Similar principle to checking if climate_temp_data is None. Will be in beta3

@ismarslomic
Copy link
Collaborator Author

Fix verified from dev. Closing the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants