AttributeError: 'NoneType' object has no attribute 'status_code'

See original GitHub issue

Apologies if this has already been raised (I’ve searched other issues and couldn’t find this error) or if this is just me being an idiot but I had the ‘camera’ working fine but I’m now seeing the below errors - Any ideas what might be causing this?

Errors:

2021-06-14 09:38:07 WARNING (MainThread) [homeassistant.components.camera] Updating xiaomi_cloud_map_extractor camera took longer than the scheduled update interval 0:00:05
2021-06-14 09:38:08 ERROR (MainThread) [homeassistant.helpers.entity] Update for camera.roborock_s5_max fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 316, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 524, in async_device_update
    raise exc
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/xiaomi_cloud_map_extractor/camera.py", line 205, in update
    self._logged_in = self._connector.login()
  File "/config/custom_components/xiaomi_cloud_map_extractor/xiaomi_cloud_connector.py", line 104, in login
    return self.login_step_1() and self.login_step_2() and self.login_step_3()
  File "/config/custom_components/xiaomi_cloud_map_extractor/xiaomi_cloud_connector.py", line 93, in login_step_3
    return response.status_code == 200
AttributeError: 'NoneType' object has no attribute 'status_code'

My config:

platform: xiaomi_cloud_map_extractor
name: Roborock S5 Max
host: 192.168.1.18
token: !secret s5_max_token
username: !secret xiaomi_miio_username
password: !secret xiaomi_miio_password
country: de
#draw: ['all']
attributes:
  - calibration_points
draw:
  - charger
  - path
  - goto_path
  - obstacles
  - ignored_obstacles
  - predicted_path
  - no_go_zones
  - no_mopping_zones
  - vacuum_position
  - virtual_walls
  - zones
store_map: true
map_transformation:
  scale: 2
  trim:
    top: 30
    left: 25
    bottom: 30
    right: 30
colors:
  color_path: [255,255,255]
  color_goto_path: [0,255,0]
  color_predicted_path: [255,255,0]
  color_map_wall_v2: [0,0,0]

The username, password & token are all correct as I can still use the vacuum via the Xiaomi Mii integration.

Thanks in advance! 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
PiotrMachowskicommented, Jun 15, 2021

Yes, but generally S5 Max has been supported for a long time now. Your instance has encountered some random errors, which should have been fixed in new release (v2.0.0 contained a lot of changes, not all of them are Viomi-specific). Please try the latest version (v2.0.1) and check if it works for you.

1reaction
PiotrMachowskicommented, Jun 14, 2021

Fixed in v2.0.0 (hopefully)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python test - AttributeError: 'NoneType' object has no attribute ...
1 Answer 1 · Sorry not really following, I am importing from requests import HTTPError. – AnonymousAlias · plus I am catching the...
Read more >
[FIXED] AttributeError: 'NoneType' object has no attribute ...
Hence, AttributeError: 'NoneType' object has no attribute 'something' error occurs when the type of object you are referencing is None.
Read more >
AttributeError: 'NoneType' object has no attribute 'status_code ...
I am receiving the following error message after I register my app with reuters through the python API: AttributeError: 'NoneType' object has no...
Read more >
AttributeError: 'NoneType' object has no attribute 'cancelled ...
Any idea when the fix will be released? It affects all our Python users.
Read more >
Why do I get AttributeError: 'NoneType' object has no attribute ...
1 Answer. You are getting AttributeError: 'NoneType' object has no attribute 'something' because NoneType means that instead of an instance of whatever Class...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found