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

Отваливаются лампочки после любого взаимодействия с ними #623

Open
Leviann opened this issue Jan 30, 2025 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Leviann
Copy link

Leviann commented Jan 30, 2025

Имеем свежую версию Yandex.Station 3.18.2 (на версии 3.18.0 все было ок)
Имеем несколько разных лампочек aqara, tapo и прочие (судя по всему авторство не имеет значения, так как в приложении яндекса ничего не отваливаеется)

И имеем следующую ошибку после любого взаимодействия с лампочками

[140023570429360] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/yandex_station/core/entity.py", line 100, in device_actions
    await self.quasar.device_actions(self.device, **kwargs)
  File "/config/custom_components/yandex_station/core/yandex_quasar.py", line 459, in device_actions
    assert resp["status"] == "ok", resp
           ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: {'request_id': 'c693360a-0430-4950-85a8-4cadcdfb9366', 'status': 'error', 'code': 'UNKNOWN_ERROR', 'message': 'Что-то пошло не так. Попробуйте позднее ещё раз.'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2795, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2838, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1006, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1078, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 644, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/config/custom_components/yandex_station/light.py", line 121, in async_turn_on
    await self.device_actions(**payload)
  File "/config/custom_components/yandex_station/core/entity.py", line 102, in device_actions
    raise HomeAssistantError(f"Device action failed: {repr(e)}")
homeassistant.exceptions.HomeAssistantError: Device action failed: AssertionError({'request_id': 'c693360a-0430-4950-85a8-4cadcdfb9366', 'status': 'error', 'code': 'UNKNOWN_ERROR', 'message': 'Что-то пошло не так. Попробуйте позднее ещё раз.'})
@KotsAO
Copy link

KotsAO commented Jan 30, 2025

Аналогичная проблема для ламп Яндекса YNDX-00010, правда иногда срабатывает нормально, а иногда отваливается.

@AlexxIT AlexxIT added the bug Something isn't working label Jan 30, 2025
@AlexxIT AlexxIT self-assigned this Jan 30, 2025
@Strannik-37
Copy link

Похоже на какой-то рудимент:

payload["brightness"] = 100500

Здесь:

(value - src_min) / (src_max - src_min) * (dst_max - dst_min) + dst_min

По идее должно быть:

((value - src_min) / (src_max - src_min)) * (dst_max - dst_min) + dst_min

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 1, 2025

@Strannik-37 спасибо! Это я тестировал фичу continue_on_error (44a6bd7). И намеренно сделал ошибку при управлении лампами. И забыл удалить.

PS. Дополнительные скобки для деления ничего не меняют в порядке выполнения арифметических действий.

@AlexxIT AlexxIT added this to the v3.18.3 milestone Feb 1, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Feb 1, 2025

Собрал альфу с фиксом https://github.com/AlexxIT/YandexStation/releases/tag/v3.18.3-alpha

@AlexxIT AlexxIT marked this as a duplicate of #619 Feb 1, 2025
@Strannik-37
Copy link

@AlexxIT, а да, извиняюсь, под вечер что-то не обратил внимания, что скобки здесь действительно ни на что не влияют. Спасибо за проект, реально очень полезно для пользователей Яндекс Станции.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants