maxbec / hassio-diyHue

Fully configurable diyHue add-on for home-assistant.
30 stars 17 forks source link

Feature request: Add ability to set the branch of diyHue repo #15

Closed HepoH3 closed 3 years ago

HepoH3 commented 3 years ago

There is an implementation of new API which I would like to test, but it's currently in flask branch of the repo. It would be great if I will have an ability to checkout this addon onto this branch.

maxbec commented 3 years ago

I will implement a diyhue-addon-beta package! :)

maxbec commented 3 years ago

Added it in b28d2f1acfd885974e38e86eae1380fe7b48e167.

Can you please check if it is working? :)

HepoH3 commented 3 years ago

Hi, thank you! Actually, I can see this addon, but can't install it. Supervisor gives this backlog (and, ofc I did removed previous addon).

21-03-27 10:56:32 ERROR (SyncWorker_4) [supervisor.docker.addon] Build log: 
Step 1/31 : ARG BUILD_FROM=hassioaddons/base-python:5.3.4
Step 2/31 : FROM ${BUILD_FROM}
 ---> 079b535a3150
Step 3/31 : SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 ---> Using cache
 ---> 15e6292f5526
Step 4/31 : ARG BUILD_ARCH=aarch64
 ---> Using cache
 ---> ff97626fcb8f
Step 5/31 : ENV BUILD_ARCHI = ${BUILD_ARCH}
 ---> Using cache
 ---> a0c2dc844efc
Step 6/31 : ENV LANG C.UTF-8
 ---> Using cache
 ---> 66428706c737
Step 7/31 : ENV DIYHUE_VERSION=master
 ---> Using cache
 ---> b755805d91a4
Step 8/31 : ENV WORKING_DIR=/opt/hue-emulator
 ---> Using cache
 ---> f9f2dfdfedc3
Step 9/31 : RUN mkdir diyhue config ${WORKING_DIR}
 ---> Using cache
 ---> f0175812e5e7
Step 10/31 : RUN apk add -q -u python3 openssl nmap psmisc iproute2 alpine-sdk build-base
 ---> Using cache
 ---> 1dd8c8634a9c
Step 11/31 : RUN curl -J -L -o $diyhue.tar.gz "https://github.com/diyhue/diyHue/archive/refs/heads/flask.tar.gz"    && tar xzvf $diyhue.tar.gz --strip-components=1 -C diyhue   && rm -rf $diyhue.tar.gz    && pip3 install -r /diyhue/requirements.txt --no-cache-dir
 ---> Using cache
 ---> 619f22bb9ecd
Step 12/31 : WORKDIR /opt/hue-emulator
 ---> Using cache
 ---> dc6407bc0f10
Step 13/31 : RUN mv /diyhue/BridgeEmulator/web-ui/                                          ./web-ui/
 ---> Running in 0057bd07741c
mv: can't rename '/diyhue/BridgeEmulator/web-ui/': No such file or directory
HepoH3 commented 3 years ago

I really don't know what the problem. I checked diyhue vs diyhue-flask folders — they pretty same, I don't understand why installation so differ. Here log when I tried to install flask and then installed dev

21-03-27 21:57:10 INFO (SyncWorker_5) [supervisor.docker.addon] Starting build for 201c4c89/amd64-addon-diyhue-beta-flask:1.4.0
21-03-27 21:57:13 ERROR (SyncWorker_5) [supervisor.docker.addon] Can't build 201c4c89/amd64-addon-diyhue-beta-flask:1.4.0: The command '/bin/bash -o pipefail -c mv /diyhue/BridgeEmulator/web-ui/                                          ./web-ui/' returned a non-zero code: 1
21-03-27 21:57:13 ERROR (SyncWorker_5) [supervisor.docker.addon] Build log: 
Step 1/31 : ARG BUILD_FROM=hassioaddons/base-python:5.3.4
Step 2/31 : FROM ${BUILD_FROM}
 ---> 079b535a3150
Step 3/31 : SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 ---> Using cache
 ---> 15e6292f5526
Step 4/31 : ARG BUILD_ARCH=aarch64
 ---> Using cache
 ---> ff97626fcb8f
Step 5/31 : ENV BUILD_ARCHI = ${BUILD_ARCH}
 ---> Using cache
 ---> a0c2dc844efc
Step 6/31 : ENV LANG C.UTF-8
 ---> Using cache
 ---> 66428706c737
Step 7/31 : ENV DIYHUE_VERSION=master
 ---> Using cache
 ---> b755805d91a4
Step 8/31 : ENV WORKING_DIR=/opt/hue-emulator
 ---> Using cache
 ---> f9f2dfdfedc3
Step 9/31 : RUN mkdir diyhue config ${WORKING_DIR}
 ---> Using cache
 ---> f0175812e5e7
Step 10/31 : RUN apk add -q -u python3 openssl nmap psmisc iproute2 alpine-sdk build-base
 ---> Using cache
 ---> 1dd8c8634a9c
Step 11/31 : RUN curl -J -L -o $diyhue.tar.gz "https://github.com/diyhue/diyHue/archive/refs/heads/flask.tar.gz"    && tar xzvf $diyhue.tar.gz --strip-components=1 -C diyhue   && rm -rf $diyhue.tar.gz    && pip3 install -r /diyhue/requirements.txt --no-cache-dir
 ---> Using cache
 ---> 619f22bb9ecd
Step 12/31 : WORKDIR /opt/hue-emulator
 ---> Using cache
 ---> dc6407bc0f10
Step 13/31 : RUN mv /diyhue/BridgeEmulator/web-ui/                                          ./web-ui/
 ---> Running in fc80e7eea141
mv: can't rename '/diyhue/BridgeEmulator/web-ui/': No such file or directory

Removing intermediate container fc80e7eea141

21-03-27 21:57:27 INFO (MainThread) [supervisor.addons] Creating Home Assistant add-on data folder /data/addons/data/201c4c89_diyhue-beta
21-03-27 21:57:27 INFO (SyncWorker_5) [supervisor.docker.addon] Starting build for 201c4c89/amd64-addon-diyhue-beta:1.4.0
21-03-27 21:58:34 INFO (MainThread) [supervisor.auth] Auth request from 'core_mosquitto' for 'mqtt_user'
21-03-27 21:58:34 INFO (MainThread) [supervisor.auth] Successful login for 'mqtt_user'
21-03-27 21:59:21 INFO (SyncWorker_5) [supervisor.docker.addon] Build 201c4c89/amd64-addon-diyhue-beta:1.4.0 done
21-03-27 21:59:21 INFO (MainThread) [supervisor.addons] Add-on '201c4c89_diyhue-beta' successfully installed

One could see that actually start of installation log of dev slightly different from flask — it has a line: 21-03-27 21:57:27 INFO (MainThread) [supervisor.addons] Creating Home Assistant add-on data folder /data/addons I don't know why there is no such line for flask intallation, but maybe that the problem.

maxbec commented 3 years ago

Thank you @HepoH3, i will check that.

maxbec commented 3 years ago

Hey @HepoH3,

I just checked the flask repo from diyhue. It differs to the diyhue master repo a lot. The error is that there is no more web-ui folgder in BridgeEmulator... But flaskUI. I changed that but i don't know if there are other things to change.

HepoH3 commented 3 years ago

Hi @MaxBec, thank you for reply and fix! Yep, now when I get how it's work, that step is passed, but there is another problem: there is no protocols folder in flask branch. Dir structure is actually a lot different, so I don't now is it possible to make it all work without much pain. But when Flask branch will eventually merged into the master this problem will still remain, but in the master addon instead.

HepoH3 commented 3 years ago

One more little thing (don't want to open issue for this): in the config tab, placeholder for the mac addres five hexademical numbers has been used instead of six — XX:XX:XX:XX:XX instead of XX:XX:XX:XX:XX:XX. If someone replaced x with numbers, the addons will not work and they will don't really know what's going on untill looking in the logs.

maxbec commented 3 years ago

Oh thank you very much for the hint!!!