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

Не отображается список станций #22

Open
2scorpio opened this issue Jan 12, 2023 · 2 comments
Open

Не отображается список станций #22

2scorpio opened this issue Jan 12, 2023 · 2 comments

Comments

@2scorpio
Copy link

2scorpio commented Jan 12, 2023

Здравствуйте.
Токен успешно получил прям из node red.
Проверил через music-yandex-bot.ru токен верный.
node red подключен к ioBroker
Стоит всё на убунте, файрвол и selinux отключены.
Станции с сервера пингуются нормально.
Докер не используется.
Но в списке станций пусто.
Станции и сервер в одной подсети.
В чём я неправ ? Как поправить ?

http://192.168.2.5:1880/mdns/7754cb02f52c7b12
// 20230113000415
// http://192.168.2.5:1880/mdns/7754cb02f52c7b12

{
"SearchResult": [

]
}

http://192.168.2.5:1880/stations/7754cb02f52c7b12
Cannot GET /stations/7754cb02f52c7b12

http://192.168.2.5:1880/yandexdevices_7754cb02f52c7b12
Cannot GET /yandexdevices_7754cb02f52c7b12

@8bitjoey
Copy link

8bitjoey commented Sep 12, 2023

та же проблема
оба запроса на /stations и /yandexdevices падают с кодом 404

не совсем понятно про условие наличия устройства в одной подсети. Оно необходимо для поиска станций или только для работы с ними?

@8bitjoey
Copy link

8bitjoey commented Sep 20, 2023

на скорую руку починил таким изменением, заработало

правда там еще почему-то отваливается checkSheduler полностью убивая nodered, так что имеет смысл обернуть его в try .. catch ну или хотя бы проверять что daySheduler вообще defined после sheduler.find. Что вполне себе кейс, учитывая что там в коде парой строк выше let sheduler = ... ? ... : [];

discovery.patch

diff --git a/nodes/yandex-login.js b/nodes/yandex-login.js
--- a/nodes/yandex-login.js     (revision 732ae0c168649dcc259568437577963192856d73)
+++ b/nodes/yandex-login.js     (date 1695241534879)
@@ -42,6 +42,10 @@

         function deviceListProcessing(deviceList) {
             deviceList.forEach(device => {
+                if (device.networkInfo && !device.address) {
+                    device.port = device.networkInfo.external_port;
+                    device.address = device.networkInfo.ip_addresses[0];
+                }
                 if (device.address && device.port ) {

                      if (node.readyList.find(item => item.id == device.id)){

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