Skip to content

Commit eb96553

Browse files
Systemd changes | root script | URL support for gif effects (#1319)
* Systemd changes and URL option for Gif Effects * Add grayscale to gif effect * WebUI adjustments * Rename version to .version * Copy runHyperionAsRoot.sh to rpi packages * Pack script into all unix packages * Start hyperion only after network is available * Snap builds removed due to poor server connection * Flexible updateHyperionUser.sh * updateHyperionUser script entered in the package * Print help on none sudo execute * Corrected embedded Python location * Replacement for the QWindowsScreen grabWindow function * Updated to latest 2.x mbedtls version 2.27 Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
1 parent f269268 commit eb96553

File tree

37 files changed

+777
-574
lines changed

37 files changed

+777
-574
lines changed

.github/workflows/apt.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ jobs:
3535
- name: Build package
3636
shell: bash
3737
run: |
38-
tr -d '\n' < version > temp && mv temp version
38+
tr -d '\n' < .version > temp && mv temp .version
3939
mkdir -p "${GITHUB_WORKSPACE}/deploy"
4040
docker run --rm \
4141
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
4242
-v "${GITHUB_WORKSPACE}:/source:rw" \
4343
ghcr.io/hyperion-project/${{ matrix.architecture }}:$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') \
4444
/bin/bash -c "cd /source && \
4545
mkdir -p debian/source && echo '3.0 (quilt)' > debian/source/format && \
46-
dch --create --distribution $(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') --package 'hyperion' -v '$(cat version)~$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]')' '${{ github.event.commits[0].message }}' && \
46+
dch --create --distribution $(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]') --package 'hyperion' -v '$(cat .version)~$(echo ${{ matrix.distribution }} | tr '[:upper:]' '[:lower:]')' '${{ github.event.commits[0].message }}' && \
4747
cp -fr LICENSE debian/copyright && \
4848
sed 's/@BUILD_DEPENDS@/${{ matrix.build-depends }}/g; s/@DEPENDS@/${{ matrix.package-depends }}/g; s/@ARCHITECTURE@/${{ matrix.architecture }}/g' debian/control.in > debian/control && \
4949
tar cf ../hyperion_2.0.0.orig.tar . && \

.github/workflows/pull-request.yml

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ jobs:
3636
with:
3737
submodules: true
3838

39-
# Append PR number to version
39+
# Append PR number to .version
4040
- name: Append PR number to version
4141
shell: bash
4242
run: |
43-
tr -d '\n' < version > temp && mv temp version
44-
echo -n "+PR${{ github.event.pull_request.number }}" >> version
43+
tr -d '\n' < .version > temp && mv temp .version
44+
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
4545
4646
# Build packages
4747
- name: Build packages
@@ -82,12 +82,12 @@ jobs:
8282
with:
8383
submodules: true
8484

85-
# Append PR number to version
85+
# Append PR number to .version
8686
- name: Append PR number to version
8787
shell: bash
8888
run: |
89-
tr -d '\n' < version > temp && mv temp version
90-
echo -n "+PR${{ github.event.pull_request.number }}" >> version
89+
tr -d '\n' < .version > temp && mv temp .version
90+
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
9191
9292
# Install dependencies
9393
- name: Install dependencies
@@ -131,12 +131,12 @@ jobs:
131131
with:
132132
submodules: true
133133

134-
# Append PR number to version
134+
# Append PR number to .version
135135
- name: Append PR number to version
136136
shell: bash
137137
run: |
138-
tr -d '\n' < version > temp && mv temp version
139-
echo -n "+PR${{ github.event.pull_request.number }}" >> version
138+
tr -d '\n' < .version > temp && mv temp .version
139+
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
140140
141141
- name: Cache Qt
142142
uses: actions/cache@v2
@@ -199,27 +199,3 @@ jobs:
199199
with:
200200
name: windows
201201
path: windows
202-
203-
##########################
204-
#### Snap (x86_64) #######
205-
##########################
206-
207-
snap:
208-
name: Snap (x86_64)
209-
runs-on: ubuntu-latest
210-
211-
steps:
212-
- name: Checkout repository
213-
uses: actions/checkout@v2
214-
215-
# Build snap package
216-
- name: Build snap
217-
id: build
218-
uses: snapcore/action-build@v1
219-
220-
# Upload snap artifact (only on tagged commit)
221-
- name: Upload snap artifact
222-
uses: actions/upload-artifact@v2
223-
with:
224-
name: snap
225-
path: ${{ steps.build.outputs.snap }}

.github/workflows/push-master.yml

Lines changed: 2 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -156,31 +156,6 @@ jobs:
156156
with:
157157
path: build/Hyperion-*
158158

159-
##########################
160-
#### Snap (x86_64) #######
161-
##########################
162-
163-
snap:
164-
name: Snap (x86_64)
165-
runs-on: ubuntu-latest
166-
167-
steps:
168-
- name: Checkout repository
169-
uses: actions/checkout@v2
170-
171-
# Build snap package
172-
- name: Build snap
173-
id: build
174-
uses: snapcore/action-build@v1
175-
176-
# Upload snap artifact (only on tagged commit)
177-
- name: Upload snap artifact
178-
if: startsWith(github.event.ref, 'refs/tags')
179-
uses: actions/upload-artifact@v2
180-
with:
181-
name: snap
182-
path: ${{ steps.build.outputs.snap }}
183-
184159
#######################################
185160
###### Publish GitHub Releases ########
186161
#######################################
@@ -195,10 +170,10 @@ jobs:
195170
uses: actions/checkout@v2
196171

197172
# generate environment variables
198-
- name: Generate environment variables from version and tag
173+
- name: Generate environment variables from .version and tag
199174
run: |
200175
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
201-
echo "VERSION=$(tr -d '\n' < version)" >> $GITHUB_ENV
176+
echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV
202177
echo "preRelease=false" >> $GITHUB_ENV
203178
204179
# If version contains alpha or beta, mark draft release as pre-release
@@ -223,35 +198,3 @@ jobs:
223198
prerelease: ${{ env.preRelease }}
224199
env:
225200
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
226-
227-
############################
228-
###### Snap Release ########
229-
############################
230-
231-
snap_publish:
232-
name: Publish Snap Release
233-
if: startsWith(github.event.ref, 'refs/tags')
234-
needs: [snap]
235-
runs-on: ubuntu-latest
236-
steps:
237-
- name: Checkout
238-
uses: actions/checkout@v2
239-
240-
# Download snap from snap job
241-
- name: Download snap from snap build
242-
id: download-artifact
243-
uses: actions/download-artifact@v2
244-
with:
245-
name: snap
246-
247-
# Get file name of the snap
248-
- name: Get file name of the snap
249-
run: echo "snap=$(ls ${{ steps.download-artifact.outputs.download-path }}/hyperion-ng_*.snap)" >> $GITHUB_ENV
250-
251-
# Publish snap build to edge channel
252-
- name: Publish snap build to edge channel
253-
uses: snapcore/action-publish@v1
254-
with:
255-
store_login: ${{ secrets.SNAP_STORE_LOGIN }}
256-
snap: ${{ env.snap }}
257-
release: edge
File renamed without changes.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PROJECT(hyperion)
66

77
# Parse semantic version of version file and write version to config
88
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cmake)
9-
file (STRINGS "version" HYPERION_VERSION)
9+
file (STRINGS ".version" HYPERION_VERSION)
1010
SetVersionNumber(HYPERION ${HYPERION_VERSION})
1111
set(DEFAULT_JSON_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/config/hyperion.config.json.default)
1212
file(READ ${DEFAULT_JSON_CONFIG_FILE} DEFAULT_JSON_CONFIG_VAR)

assets/webconfig/css/darkMode.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ select.form-control {
299299
color: #DDDDDD;
300300
}
301301

302+
.radio__field:checked ~ .radio__icon::before {
303+
background: #fff;
304+
}
305+
302306
.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle) {
303307
border-bottom-right-radius: 4px;
304308
border-top-right-radius: 4px;

assets/webconfig/css/hyperion.css

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,88 @@ li a:active:after {
764764
padding: 15px;
765765
}
766766

767+
/*https://github.com/json-editor/json-editor/blob/2e005a2bd34c05803702d8bc1347efde7a4926ce/docs/radio.html#L37 radiobox for Json-Editor*/
768+
.radio {
769+
position: relative;
770+
display: inline-block;
771+
min-width: 1.625rem;
772+
min-height: 1.625rem;
773+
max-width: 100%;
774+
}
775+
776+
.radio:first-child {
777+
margin-right: 20px;
778+
}
779+
780+
.radio__field {
781+
display: none;
782+
}
783+
784+
.radio__icon {
785+
position: absolute;
786+
top: -0.125rem;
787+
left: -0.125rem;
788+
width: 1.875rem;
789+
height: 1.875rem;
790+
-webkit-box-sizing: border-box;
791+
box-sizing: border-box;
792+
border: 0.125rem solid #616161;
793+
border-radius: 50%;
794+
cursor: pointer;
795+
}
796+
797+
.radio__icon::before {
798+
position: absolute;
799+
content: '';
800+
top: 50%;
801+
left: 50%;
802+
width: 0.75rem;
803+
height: 0.75rem;
804+
-webkit-transform: translate(-50%, -50%);
805+
transform: translate(-50%, -50%);
806+
border-radius: 50%;
807+
visibility: hidden;
808+
}
809+
810+
.radio__icon::after {
811+
position: absolute;
812+
content: '';
813+
top: -0.4375rem;
814+
right: -0.4375rem;
815+
bottom: -0.4375rem;
816+
left: -0.4375rem;
817+
}
818+
819+
.radio__label {
820+
line-height: 1.5rem;
821+
display: block;
822+
padding: 0.0625rem 0 0 2.375rem;
823+
cursor: pointer;
824+
}
825+
826+
.radio__field:checked ~ .radio__icon::before {
827+
background: #616161;
828+
visibility: visible;
829+
}
830+
831+
/* disabled state css */
832+
.radio__field:disabled:checked ~ .radio__icon,
833+
.radio__field:disabled:not(:checked) ~ .radio__icon {
834+
cursor: default;
835+
border-color: #959899;
836+
}
837+
838+
.radio__field:disabled:checked ~ .radio__label,
839+
.radio__field:disabled:not(:checked) ~ .radio__label {
840+
cursor: default;
841+
color: #959899;
842+
}
843+
844+
.radio__field:disabled:checked ~ .radio__icon::before,
845+
.radio__field:disabled:not(:checked) ~ .radio__icon::before {
846+
cursor: default;
847+
background-color: #959899;
848+
}
767849

768850
/*https://github.com/flatlogic/awesome-bootstrap-checkbox slighty edited for our purposes*/
769851
.checkbox {

assets/webconfig/i18n/de.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,12 +636,17 @@
636636
"edt_eff_flag_header": "Flaggen",
637637
"edt_eff_flag_header_desc": "Verpasse deinen LEDs die Farben deines Landes. Du kannst mehr als eine Flagge auswählen, je nach Intervall werden diese dann abwechselnd angezeigt.",
638638
"edt_eff_fps": "Bilder pro Sekunde",
639+
"edt_eff_grayscale": "Graustufen",
639640
"edt_eff_frequency": "Frequenz",
640641
"edt_eff_gif_header": "GIFs",
641642
"edt_eff_gif_header_desc": "Dieser Effekt spielt .gif Dateien ab. Bietet die Möglichkeit kleine GIF-Videos abzuspielen.",
642643
"edt_eff_height": "Höhe",
643644
"edt_eff_huechange": "Farbänderung",
645+
"edt_eff_image_source": "Bildquelle",
646+
"edt_eff_image_source_file": "Lokale Datei",
647+
"edt_eff_image_source_url": "URL",
644648
"edt_eff_image": "Bilddatei",
649+
"edt_eff_url": "Bildadresse",
645650
"edt_eff_initial_blink": "Blinken beim Start",
646651
"edt_eff_interval": "Intervall",
647652
"edt_eff_knightrider_header": "Knight Rider",
@@ -1018,4 +1023,4 @@
10181023
"wiz_yeelight_intro1": "Dieser Assistent hilft dir bei der Konfiguration von Hyperion für Yeelight. Zu den Funktionen zählen ein automatisches Finden der Yeelights, die einzelnen Lampen unterschiedlichen Bereichen im Bild zuzuordnen und weitere Einstellungen von Hyperion automatisch anzupassen. Kurz gesagt: Komplette Einrichtung mit ein paar Klicks.",
10191024
"wiz_yeelight_title": "Yeelight Einrichtungsassistent",
10201025
"wiz_yeelight_unsupported": "Nicht unterstützt"
1021-
}
1026+
}

assets/webconfig/i18n/en.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,16 @@
643643
"edt_eff_flag_header_desc": "Let your LEDs shine bright in the colours of your country. You can select more than one flag and they will change based on the interval time.",
644644
"edt_eff_fps": "Frames per seconds",
645645
"edt_eff_frequency": "Frequency",
646+
"edt_eff_grayscale": "Grayscale",
646647
"edt_eff_gif_header": "GIF's",
647648
"edt_eff_gif_header_desc": "This effect plays .gif files, provide a simple video like loop as effect.",
648649
"edt_eff_height": "Height",
649650
"edt_eff_huechange": "Color change",
651+
"edt_eff_image_source": "Image source",
652+
"edt_eff_image_source_file": "Local file",
653+
"edt_eff_image_source_url": "URL",
650654
"edt_eff_image": "Image file",
655+
"edt_eff_url": "Image adress",
651656
"edt_eff_initial_blink" : "Flash for attention",
652657
"edt_eff_interval": "Interval",
653658
"edt_eff_knightrider_header": "Knight Rider",

assets/webconfig/js/content_effectsconfigurator.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ $(document).ready(function () {
5555
testrun = true;
5656

5757
var args = effects_editor.getEditor('root.args');
58-
requestTestEffect(effectName, effectPyScript, JSON.stringify(args.getValue()), imageData);
58+
if ($('input[type=radio][value=url]').is(':checked')) {
59+
requestTestEffect(effectName, effectPyScript, JSON.stringify(args.getValue()), "");
60+
} else {
61+
requestTestEffect(effectName, effectPyScript, JSON.stringify(args.getValue()), imageData);
62+
}
5963
};
6064

6165
// Specify upload handler for image files
@@ -133,7 +137,12 @@ $(document).ready(function () {
133137

134138
// Save Effect
135139
$('#btn_write').off().on('click', function () {
136-
requestWriteEffect(effectName, effectPyScript, JSON.stringify(effects_editor.getValue()), imageData);
140+
if ($('input[type=radio][value=url]').is(':checked')) {
141+
requestWriteEffect(effectName, effectPyScript, JSON.stringify(effects_editor.getValue()), "");
142+
} else {
143+
requestWriteEffect(effectName, effectPyScript, JSON.stringify(effects_editor.getValue()), imageData);
144+
}
145+
137146
$(window.hyperion).one("cmd-create-effect", function (event) {
138147
if (event.response.success)
139148
showInfoDialog('success', "", $.i18n('infoDialog_effconf_created_text', effectName));

0 commit comments

Comments
 (0)