al-one / hass-xiaomi-miot

Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成
https://miot-spec.com
Apache License 2.0
4.43k stars 619 forks source link

Error doing job: Task exception was never retrieved (AttributeError: can't set attribute) after upgrade to 04.12 #309

Closed new-kirte closed 2 years ago

new-kirte commented 2 years ago

After upgrade to version 04/12. Multiple errors are shown in the log:

Logger: homeassistant Source: custom_components/xiaomi_miot/camera.py:390 Integration: Xiaomi Miot Auto (documentation, issues) First occurred: 8:02:15 AM (1 occurrences) Last logged: 8:02:15 AM

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 315, in preload_stream stream = await camera.create_stream() File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 455, in create_stream source = await self.stream_source() File "/config/custom_components/xiaomi_miot/camera.py", line 326, in stream_source return await self.hass.async_add_executor_job(partial(fun, *kwargs)) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(self.args, **self.kwargs) File "/config/custom_components/xiaomi_miot/camera.py", line 390, in get_stream_address self.is_streaming = self._last_url and True AttributeError: can't set attribute

Logger: aiohttp.server Source: custom_components/xiaomi_miot/camera.py:390 Integration: Xiaomi Miot Auto (documentation, issues) First occurred: 8:05:02 AM (1 occurrences) Last logged: 8:05:02 AM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 220, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 181, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 629, in get return await self.handle(request, camera) File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 647, in handle image = await _async_get_image( File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 166, in _async_get_image image_bytes = await camera.async_camera_image( File "/config/custom_components/xiaomi_miot/camera.py", line 101, in async_camera_image url = await self.image_source() File "/config/custom_components/xiaomi_miot/camera.py", line 334, in image_source return await self.stream_source() File "/config/custom_components/xiaomi_miot/camera.py", line 326, in stream_source return await self.hass.async_add_executor_job(partial(fun, *kwargs)) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(self.args, **self.kwargs) File "/config/custom_components/xiaomi_miot/camera.py", line 390, in get_stream_address self.is_streaming = self._last_url and True AttributeError: can't set attribute

Camera in question:

access_token: 7467bd557125e66b3f8d9d40cc52de0db3d7a5389abd28414***************
brand: chuangmi
frontend_stream_type: hls
model: chuangmi.camera.ipc019
lan_ip: 192.168.*.*
mac_address: **:**:**:**:**:**
entity_class: MiotCameraEntity
home_room: **********'s home Play Area
miot_type: urn:miot-spec-v2:device:camera:0000A01C:chuangmi-ipc019:1
camera_control.on: true
camera_control.image_rollover: 180
camera_control.night_shot: 0
camera_control.time_watermark: true
camera_control.wdr_mode: true
glimmer_full_color-2-6: true
camera_control.recording_mode: 3
camera_control.motion_tracking: false
stream_status-3-1: 1
state_updater: cloud
motion_video_time: '2021-12-14 07:43:26'
motion_video_type: ObjectMotion:PeopleMotion
sub_entities:
  - camera_control.on
  - motion_event
motion_video_latest:
  startDuration: 0
  cut: false
  offset: 0
  isCloud: false
  isRead: false
  videoStoreId: >-
    GKAC4teuJHG30ICzVOdbH2IlOrRoQHhSm1sZ3XE8I89hJeuXvwQFXyeDhNjc57M0mu6QVoN6_kiwH3aMqhn3LzjNd7tyCmoESH4q2Gcd4VtG4J3LFOgbaR0Dy-4SuNQ2Z8i4ylUVUqnQZNbx5Uc7zd6n2a7Vx3EKkkQcEMWY7jagjrpCSSGEpzIne7d9qeYhA-Y27G1wOV7ZVgCuhvbemFMuAkjr6CQ4VJh1RyU52rysnkQjjE4DsK9CrJKEGExfredAwQULQeOcJeDKZRu23dBFn3SA0CHaMJg43dXlX5giF_ulvSTgsl-zkLdWtuJ7RiuxDdmbX8sMubh0cHbWg_pXwyxcPbE8BSNDk0f7l8KPMKDBAFkwrvpum8VTsM6CchkEGBKe5qcfpSRDlZbCQK-1NKbsugEYENQgzYetZ1S13RER3m0KoNQYFPNmXx-uC7FyXr4Br4mfYhKwu5vKAA
  eventType: ObjectMotion:PeopleMotion
  expireTime: 1640058210698
  isAlarm: true
  imgStoreId: >-
    GKACaZEAD4pQ8VL2AEv8afxge-VY7sM8y9bJlUIenP7BqRBDapYcxIU6jHwFoScBXdX61urRwF7Gi87g_4K_VLhz4CS1Lc4HlLqC_YDECgliusEkuaQMNJ4vSVfv0ZQq2QDHjdMo2LNIe8WXhhJoWZwgkSpoRc4zmelfqPzaY6-rHyl7svz2o6W9QV5ot6GAw6Bf8VQNqvB1539QL83aj3EDWpDH9KyE_eGLSnNHCuczFL2dqcWfhbBIl5P-Uf6igoK3ZMC2qyY7yiQcKNFK-KfEseTRgkhZKIJWOqrJAMR2AUv-HwdagnPxIT1nKdsB7p296_3Anbw69H2pzI3Ka16ZCGY5wEiLVxEg3cs4sDWs3hvzfm9sfTMsQnlCxmcaNV_4GBKD_UNYcmdAPI4AR2RColJd_AEYEOL4XR12f9YO7GlFsbrXFq8YFGLwKlZlxvNgA7zckDW_fFYKw0_vAA
  fileId: '67575900115834240'
  extraInfo: ''
miot_action_result:
  did: '322523286'
  miid: 0
  siid: 4
  aiid: 1
  code: 0
  out:
    - >-
      https://sg19.livestreaming.io.mi.com/hlstranscoder/G*******************A_H265transH264/playlist.m3u8
  exe_time: 0
  withLatency: 0
entity_picture: >-
  /api/camera_proxy/camera.chuangmi_ipc019_4c79_camera_control?token=7467bd557125e66b3f8d9d40cc52de0db3d7a5389abd2841****************
friendly_name: Play Area Camera Camera Control
supported_features: 3
motion_stream_slice: -1
sub_motion_stream: true
keep_streaming: true
video_attribute: 1
al-one commented 2 years ago

https://github.com/al-one/hass-xiaomi-miot/issues/303#issuecomment-993330558

new-kirte commented 2 years ago

@al-one Thanks. When is the fix going to be merged to a released version?

al-one commented 2 years ago

There will be a new version soon.