Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor: Unable to retrieve map. Python error is thrown

Checklist

  • I have updated the integration to the latest version available
  • I have checked if the problem is already reported

The problem

It is currently unable to retrieve a new map. Might be due to an update of python? See stacktrace below.

What version of an integration has described problem?

v2.2.0

What was the last working version of an integration?

v2.2.0

What vacuum model do you have problems with?

roborock s6

What version of Home Assistant do you use?

2023.8.0

What type of installation are you running?

Home Assistant OS

Camera’s configuration

camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    map_transformation:
      scale: 2 
      trim:
        top: 25
        bottom: 25
        left: 15
        right: 15
    draw: ['charger', 'cleaned_area', 'goto_path', 'vacuum_position', 'path', 'predicted_path', 'room_names']
    attributes:
      - calibration_points
      - rooms
      - vacuum_room_name
      - vacuum_position
      - cleaned_rooms
    scan_interval:
     seconds: 15
    auto_update: false
    colors:
     color_map_inside: [28,28,28]
     color_map_outside: [28,28,28]
     color_map_wall: [100, 196, 254]
     color_map_wall_v2: [93, 109, 126]
     color_grey_wall: [28,28,28]
     color_path: [0, 0, 0]
     color_goto_path: [0, 255, 0]
     color_predicted_path: [255, 255, 0, 0]
     color_zones: [0xAD, 0xD8, 0xFF, 0x8F]
     color_zones_outline: [0xAD, 0xD8, 0xFF]
     color_virtual_walls: [255, 0, 0]
     color_no_go_zones: [255, 33, 55, 127]
     color_no_go_zones_outline: [255, 0, 0]
     color_no_mop_zones: [163, 130, 211, 127]
     color_no_mop_zones_outline: [163, 130, 211]
     color_charger: [0x66, 0xfe, 0xda, 0x7f]
     color_robo: [75, 235, 149]
     color_unknown: [0, 0, 0]
     color_scan: [0xDF, 0xDF, 0xDF]

Errors shown in the HA logs (if applicable)

Update for camera.xiaomi_cloud_map_extractor fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 699, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 940, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_cloud_map_extractor/camera.py", line 282, in update
    self._set_map_data(MapDataParser.create_empty(self._colors, str(self._status)))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_cloud_map_extractor/common/map_data_parser.py", line 16, in create_empty
    empty_map = ImageHandler.create_empty_map_image(colors, text)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_cloud_map_extractor/common/image_handler.py", line 76, in create_empty_map_image
    w, h = draw.textsize(text)
           ^^^^^^^^^^^^^
AttributeError: 'ImageDraw' object has no attribute 'textsize'

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 17 (5 by maintainers)

Most upvoted comments

Fixed in v2.2.1