mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-03-03 07:06:51 +01:00
Compare commits
7 Commits
5ff3a25b2f
...
1c896da331
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c896da331 | ||
|
|
16673df8cf | ||
|
|
cb4c26acfd | ||
|
|
fda7ca4574 | ||
|
|
8e2e8d1e82 | ||
|
|
4e36f47774 | ||
|
|
858dac73d0 |
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -58,5 +58,5 @@ _If applicable, add screenshots/pictures to help explain your problem._
|
|||||||
_Add any other context about the problem here._
|
_Add any other context about the problem here._
|
||||||
_Please note here in case you are using ioBroker_
|
_Please note here in case you are using ioBroker_
|
||||||
|
|
||||||
### PANEL / FIRMWARE VERION
|
### PANEL / FIRMWARE VERSION
|
||||||
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
|
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/feature-request.md
vendored
2
.github/ISSUE_TEMPLATE/feature-request.md
vendored
@@ -24,5 +24,5 @@ _A clear and concise description of what the feature should do._
|
|||||||
### ADDITIONAL CONTEXT
|
### ADDITIONAL CONTEXT
|
||||||
_Add any other context about the problem here._
|
_Add any other context about the problem here._
|
||||||
|
|
||||||
### PANEL / FIRMWARE VERION
|
### PANEL / FIRMWARE VERSION
|
||||||
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
|
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ ReleaseNotes:
|
|||||||
- 09.02.2024 - v4.3.3.42 Spotify Media-Player: Dynamic loading of the speaker list, playlist, tracklist, fix repeat, add seek, add elapsed/duration
|
- 09.02.2024 - v4.3.3.42 Spotify Media-Player: Dynamic loading of the speaker list, playlist, tracklist, fix repeat, add seek, add elapsed/duration
|
||||||
- 10.02.2024 - v4.3.3.42 Spotify Minor Fixes; Add miValue / maxValue to Volume-Slider
|
- 10.02.2024 - v4.3.3.42 Spotify Minor Fixes; Add miValue / maxValue to Volume-Slider
|
||||||
- 10.02.2024 - v4.3.3.43 Fix: cardGrid2 => 9 Entities for Layout 'us-p' issue #1167
|
- 10.02.2024 - v4.3.3.43 Fix: cardGrid2 => 9 Entities for Layout 'us-p' issue #1167
|
||||||
|
- 11.02.2024 - v4.3.3.43 Fix VolumeSlider
|
||||||
|
|
||||||
Todo:
|
Todo:
|
||||||
- XX.XX.XXXX - v5.0.0 Change the bottomScreensaverEntity (rolling) if more than 6 entries are defined
|
- XX.XX.XXXX - v5.0.0 Change the bottomScreensaverEntity (rolling) if more than 6 entries are defined
|
||||||
@@ -4768,97 +4769,25 @@ function unsubscribeMediaSubscriptions(): void {
|
|||||||
|
|
||||||
function subscribeMediaSubscriptions(id: string): void {
|
function subscribeMediaSubscriptions(id: string): void {
|
||||||
on({id: [id + '.STATE',
|
on({id: [id + '.STATE',
|
||||||
id + '.VOLUME',
|
|
||||||
id + '.ARTIST',
|
id + '.ARTIST',
|
||||||
id + '.ALBUM',
|
|
||||||
id + '.TITLE',
|
id + '.TITLE',
|
||||||
|
id + '.ALBUM',
|
||||||
|
id + '.VOLUME',
|
||||||
id + '.REPEAT',
|
id + '.REPEAT',
|
||||||
id + '.SHUFFLE'], change: "any"}, async function () {
|
id + '.SHUFFLE',
|
||||||
(function () { if (timeoutMedia) { clearTimeout(timeoutMedia); timeoutMedia = null; } })();
|
id + '.DURATION',
|
||||||
timeoutMedia = setTimeout(async function () {
|
id + '.ELAPSED'], change: "any", ack: true}, async function () {
|
||||||
if (useMediaEvents) {
|
if (useMediaEvents && pageCounter == 1) {
|
||||||
GeneratePage(activePage!);
|
GeneratePage(activePage!);
|
||||||
setTimeout(async function () {
|
}
|
||||||
GeneratePage(activePage!);
|
|
||||||
}, 1500);
|
|
||||||
}
|
|
||||||
},50)
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function subscribeMediaSubscriptionsSonosAdd(id: string): void {
|
function subscribeMediaSubscriptionsSonosAdd(id: string): void {
|
||||||
on({id: [id + '.QUEUE',
|
on({id: [id + '.QUEUE'], change: "any", ack: true}, async function () {
|
||||||
id + '.DURATION',
|
if (useMediaEvents && pageCounter == 1) {
|
||||||
id + '.ELAPSED'], change: "any"}, async function () {
|
GeneratePage(activePage!);
|
||||||
(function () { if (timeoutMedia) { clearTimeout(timeoutMedia); timeoutMedia = null; } })();
|
}
|
||||||
timeoutMedia = setTimeout(async function () {
|
|
||||||
if (useMediaEvents) {
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
setTimeout(async function () {
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
}, 50);
|
|
||||||
}
|
|
||||||
},50)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function subscribeMediaSubscriptionsAlexaAdd(id: string): void {
|
|
||||||
on({id: [id + '.DURATION',
|
|
||||||
id + '.ELAPSED'], change: "any"}, async function () {
|
|
||||||
(function () { if (timeoutMedia) { clearTimeout(timeoutMedia); timeoutMedia = null; } })();
|
|
||||||
timeoutMedia = setTimeout(async function () {
|
|
||||||
if (useMediaEvents) {
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
setTimeout(async function () {
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
}, 50);
|
|
||||||
}
|
|
||||||
},50)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function subscribeMediaSubscriptionsBoseAdd(id: string): void {
|
|
||||||
on({id: [id + '.DURATION',
|
|
||||||
id + '.ELAPSED'], change: "any"}, async function () {
|
|
||||||
(function () { if (timeoutMedia) { clearTimeout(timeoutMedia); timeoutMedia = null; } })();
|
|
||||||
timeoutMedia = setTimeout(async function () {
|
|
||||||
if (useMediaEvents) {
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
setTimeout(async function () {
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
}, 50);
|
|
||||||
}
|
|
||||||
},50)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function subscribeMediaSubscriptionsSqueezeboxAdd(id: string): void {
|
|
||||||
on({id: [id + '.DURATION',
|
|
||||||
id + '.ELAPSED'], change: "any"}, async function () {
|
|
||||||
(function () { if (timeoutMedia) { clearTimeout(timeoutMedia); timeoutMedia = null; } })();
|
|
||||||
timeoutMedia = setTimeout(async function () {
|
|
||||||
if (useMediaEvents) {
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
setTimeout(async function () {
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
}, 50);
|
|
||||||
}
|
|
||||||
},50)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function subscribeMediaSubscriptionsSpotifyAdd(id: string): void {
|
|
||||||
on({id: [id + '.DURATION',
|
|
||||||
id + '.ELAPSED'], change: "any"}, async function () {
|
|
||||||
(function () { if (timeoutMedia) { clearTimeout(timeoutMedia); timeoutMedia = null; } })();
|
|
||||||
timeoutMedia = setTimeout(async function () {
|
|
||||||
if (useMediaEvents) {
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
setTimeout(async function () {
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
}, 50);
|
|
||||||
}
|
|
||||||
},50)
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5159,14 +5088,7 @@ function GenerateMediaPage(page: NSPanel.PageMedia): NSPanel.Payload[] {
|
|||||||
subscribeMediaSubscriptions(page.items[0].id);
|
subscribeMediaSubscriptions(page.items[0].id);
|
||||||
if (v2Adapter == 'sonos') {
|
if (v2Adapter == 'sonos') {
|
||||||
subscribeMediaSubscriptionsSonosAdd(page.items[0].id);
|
subscribeMediaSubscriptionsSonosAdd(page.items[0].id);
|
||||||
} else if (v2Adapter == 'alexa2') {
|
|
||||||
subscribeMediaSubscriptionsAlexaAdd(page.items[0].id);
|
|
||||||
} else if (v2Adapter == 'bosesoundtouch') {
|
|
||||||
subscribeMediaSubscriptionsBoseAdd(page.items[0].id);
|
|
||||||
} else if (v2Adapter == 'squeezeboxrpc') {
|
|
||||||
subscribeMediaSubscriptionsSqueezeboxAdd(page.items[0].id);
|
|
||||||
} else if (v2Adapter == 'spotify-premium') {
|
} else if (v2Adapter == 'spotify-premium') {
|
||||||
subscribeMediaSubscriptionsSpotifyAdd(page.items[0].id);
|
|
||||||
setState(vInstance + 'getDevices', true);
|
setState(vInstance + 'getDevices', true);
|
||||||
setState(vInstance + 'getPlaybackInfo', true);
|
setState(vInstance + 'getPlaybackInfo', true);
|
||||||
setState(vInstance + 'getPlaylists', true);
|
setState(vInstance + 'getPlaylists', true);
|
||||||
@@ -5179,14 +5101,6 @@ function GenerateMediaPage(page: NSPanel.PageMedia): NSPanel.Payload[] {
|
|||||||
subscribeMediaSubscriptions(page.items[0].id);
|
subscribeMediaSubscriptions(page.items[0].id);
|
||||||
if (v2Adapter == 'sonos') {
|
if (v2Adapter == 'sonos') {
|
||||||
subscribeMediaSubscriptionsSonosAdd(page.items[0].id);
|
subscribeMediaSubscriptionsSonosAdd(page.items[0].id);
|
||||||
} else if (v2Adapter == 'alexa2') {
|
|
||||||
subscribeMediaSubscriptionsAlexaAdd(page.items[0].id);
|
|
||||||
} else if (v2Adapter == 'bosesoundtouch') {
|
|
||||||
subscribeMediaSubscriptionsBoseAdd(page.items[0].id);
|
|
||||||
} else if (v2Adapter == 'squeezeboxrpc') {
|
|
||||||
subscribeMediaSubscriptionsSqueezeboxAdd(page.items[0].id);
|
|
||||||
} else if (v2Adapter == 'spotify-premium') {
|
|
||||||
subscribeMediaSubscriptionsSpotifyAdd(page.items[0].id);
|
|
||||||
}
|
}
|
||||||
} else if (page.type == 'cardMedia' && pageCounter == -1) {
|
} else if (page.type == 'cardMedia' && pageCounter == -1) {
|
||||||
//Do Nothing
|
//Do Nothing
|
||||||
@@ -5794,8 +5708,6 @@ function GenerateMediaPage(page: NSPanel.PageMedia): NSPanel.Payload[] {
|
|||||||
if (Debug) {
|
if (Debug) {
|
||||||
log('GenerateMediaPage payload: ' + JSON.stringify(out_msgs), 'info');
|
log('GenerateMediaPage payload: ' + JSON.stringify(out_msgs), 'info');
|
||||||
}
|
}
|
||||||
if (Debug) log(JSON.stringify(out_msgs).length);
|
|
||||||
if (Debug) log('GenerateMediaPage payload: ' + JSON.stringify(out_msgs), 'info');
|
|
||||||
return out_msgs
|
return out_msgs
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
log('error at function GenerateMediaPage: ' + err.message, 'warn');
|
log('error at function GenerateMediaPage: ' + err.message, 'warn');
|
||||||
@@ -6723,8 +6635,8 @@ function HandleButtonEvent(words: any): void {
|
|||||||
|
|
||||||
switch (deviceAdapterRP) {
|
switch (deviceAdapterRP) {
|
||||||
case 'spotify-premium':
|
case 'spotify-premium':
|
||||||
log(getState(id + '.REPEAT').val)
|
if (Debug) log(getState(id + '.REPEAT').val);
|
||||||
let stateSpotifyRepeat = getState(id + '.REPEAT').val
|
let stateSpotifyRepeat = getState(id + '.REPEAT').val;
|
||||||
if (stateSpotifyRepeat == 'off') {
|
if (stateSpotifyRepeat == 'off') {
|
||||||
setIfExists(id + '.REPEAT', 'context');
|
setIfExists(id + '.REPEAT', 'context');
|
||||||
} else if (stateSpotifyRepeat == 'context') {
|
} else if (stateSpotifyRepeat == 'context') {
|
||||||
@@ -6736,7 +6648,7 @@ function HandleButtonEvent(words: any): void {
|
|||||||
break;
|
break;
|
||||||
case 'bosesoundtouch':
|
case 'bosesoundtouch':
|
||||||
if (Debug) log(adapterInstanceRepeat);
|
if (Debug) log(adapterInstanceRepeat);
|
||||||
let stateBoseRepeat = getState(id + '.REPEAT').val
|
let stateBoseRepeat = getState(id + '.REPEAT').val;
|
||||||
if (stateBoseRepeat == 'REPEAT_OFF') {
|
if (stateBoseRepeat == 'REPEAT_OFF') {
|
||||||
setIfExists(adapterInstanceRepeat + 'key', 'REPEAT_ALL');
|
setIfExists(adapterInstanceRepeat + 'key', 'REPEAT_ALL');
|
||||||
} else if (stateBoseRepeat == 'REPEAT_ALL') {
|
} else if (stateBoseRepeat == 'REPEAT_ALL') {
|
||||||
@@ -6747,7 +6659,7 @@ function HandleButtonEvent(words: any): void {
|
|||||||
GeneratePage(activePage!);
|
GeneratePage(activePage!);
|
||||||
break;
|
break;
|
||||||
case 'sonos':
|
case 'sonos':
|
||||||
let stateSonosRepeat = getState(id + '.REPEAT').val
|
let stateSonosRepeat = getState(id + '.REPEAT').val;
|
||||||
if (stateSonosRepeat == 0) {
|
if (stateSonosRepeat == 0) {
|
||||||
setIfExists(id + '.REPEAT', 1);
|
setIfExists(id + '.REPEAT', 1);
|
||||||
} else if (stateSonosRepeat == 1) {
|
} else if (stateSonosRepeat == 1) {
|
||||||
@@ -7046,16 +6958,11 @@ function HandleButtonEvent(words: any): void {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'volumeSlider':
|
case 'volumeSlider':
|
||||||
pageCounter = -1;
|
subscribeMediaSubscriptions(id);
|
||||||
(function () { if (timeoutSlider) { clearTimeout(timeoutSlider); timeoutSlider = null; } })();
|
useMediaEvents = true;
|
||||||
timeoutSlider = setTimeout(async function () {
|
pageCounter = 1;
|
||||||
setTimeout(async function () {
|
let vVolume = scale(parseInt(words[4]), 100, 0, activePage.items[0].minValue ?? 0, activePage.items[0].maxValue ?? 100);
|
||||||
let vVolume = scale(parseInt(words[4]), 100, 0, activePage.items[0].minValue ?? 0, activePage.items[0].maxValue ?? 100);
|
setIfExists(id + '.VOLUME', Math.floor(vVolume));
|
||||||
setIfExists(id + '.VOLUME', Math.floor(vVolume));
|
|
||||||
pageCounter = 1;
|
|
||||||
GeneratePage(activePage!);
|
|
||||||
}, 10);
|
|
||||||
}, 50);
|
|
||||||
break;
|
break;
|
||||||
case 'mode-speakerlist':
|
case 'mode-speakerlist':
|
||||||
let pageItem = findPageItem(id);
|
let pageItem = findPageItem(id);
|
||||||
@@ -8967,7 +8874,7 @@ function HandleScreensaverUpdate(): void {
|
|||||||
val = parseFloat(val);
|
val = parseFloat(val);
|
||||||
}
|
}
|
||||||
let iconColor = rgb_dec565(White);
|
let iconColor = rgb_dec565(White);
|
||||||
let icon;
|
let icon;
|
||||||
if (config.bottomScreensaverEntity[i].ScreensaverEntityIconOn && existsObject(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn!)) {
|
if (config.bottomScreensaverEntity[i].ScreensaverEntityIconOn && existsObject(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn!)) {
|
||||||
let iconName = getState(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn!).val;
|
let iconName = getState(config.bottomScreensaverEntity[i].ScreensaverEntityIconOn!).val;
|
||||||
icon = Icons.GetIcon(iconName);
|
icon = Icons.GetIcon(iconName);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
||||||
name: NSPanel Lovelace UI Addon
|
name: NSPanel Lovelace UI Addon
|
||||||
version: "4.7.78"
|
version: "4.7.80"
|
||||||
slug: nspanel-lovelace-ui
|
slug: nspanel-lovelace-ui
|
||||||
description: NSPanel Lovelace UI Addon
|
description: NSPanel Lovelace UI Addon
|
||||||
services:
|
services:
|
||||||
|
|||||||
@@ -209,11 +209,11 @@ class HAEntity(panel_cards.Entity):
|
|||||||
forecast = libs.home_assistant.execute_script(
|
forecast = libs.home_assistant.execute_script(
|
||||||
entity_name=self.entity_id,
|
entity_name=self.entity_id,
|
||||||
domain='weather',
|
domain='weather',
|
||||||
service="get_forecast",
|
service="get_forecasts",
|
||||||
service_data={
|
service_data={
|
||||||
'type': forecast_type
|
'type': forecast_type
|
||||||
}
|
}
|
||||||
).get("forecast", [])
|
).get(self.entity_id,{}).get("forecast", [])
|
||||||
if len(forecast) > pos:
|
if len(forecast) > pos:
|
||||||
forcast_pos = forecast[pos]
|
forcast_pos = forecast[pos]
|
||||||
forcast_condition = forcast_pos.get("condition", "")
|
forcast_condition = forcast_pos.get("condition", "")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
paho-mqtt
|
paho-mqtt==1.6.1
|
||||||
pyyaml
|
pyyaml
|
||||||
websockets
|
websockets
|
||||||
websocket-client
|
websocket-client
|
||||||
|
|||||||
Reference in New Issue
Block a user