Skip to content

Commit 217b560

Browse files
author
ticaki
committed
grid scrolling improved
1 parent 925e501 commit 217b560

9 files changed

+19
-19
lines changed

.vscode/settings.json

-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
{
22
"typescript.tsdk": "node_modules/typescript/lib",
33
"eslint.enable": true,
4-
/*"editor.formatOnSave": true,
5-
"editor.defaultFormatter": "esbenp.prettier-vscode",
6-
"[typescript]": {
7-
"editor.codeActionsOnSave": {
8-
"source.organizeImports": "explicit",
9-
}
10-
},*/
11-
//"eslint.codeActionsOnSave.mode": "problems",
124
"json.schemas": [
135
{
146
"fileMatch": [

ALIAS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
### light
132132
| Channel role | State ID | common.type | common.role | required | common.write | description |
133133
| :---: | :--- | :--- | :--- | :---: | :---: | :--- |
134-
| **light** | ACTUAL | boolean| sensor.light | | | |
134+
| **light** | ACTUAL | boolean| sensor.light | X | | |
135135
| **"** | SET | boolean| switch.light | X | X | |
136136
| **"** | COLORDEC | number| state | | | |
137137
| **"** | BUTTONTEXT | string| state | | | |

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ Sind natürlich alles Dataitems
308308
### **WORK IN PROGRESS**
309309
- (ticaki) fixed nav service right
310310
- (ticaki) screensaver rotation time added
311+
- (ticaki) grid scrolling improved
312+
- (ticaki) Feedback from the script improved
311313

312314
### 0.1.1 (2025-02-27)
313315
- (ticaki) fixed color fading

build/lib/const/config-manager-const.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/const/config-manager-const.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/pages/pageMenu.js

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/pages/pageMenu.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/const/config-manager-const.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export const requiredScriptDataPoints: requiredDatapoints = {
289289
name: 'light',
290290
description: 'ein Lichtschalter',
291291
data: {
292-
ACTUAL: { role: 'sensor.light', type: 'boolean', required: false, writeable: false },
292+
ACTUAL: { role: 'sensor.light', type: 'boolean', required: true, writeable: false },
293293
SET: { role: 'switch.light', type: 'boolean', required: true, writeable: true },
294294
COLORDEC: { role: 'state', type: 'number', required: false, writeable: false }, //Farbcode über DP steuern
295295
BUTTONTEXT: { role: 'state', type: 'string', required: false, writeable: false }, //Button-Text über DP steuern bei cardEntity

src/lib/pages/pageMenu.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ export class PageMenu extends Page {
162162
const pageScroll = this.config.scrollType === 'page';
163163

164164
const length = this.tempItems ? this.tempItems.length : this.pageItems ? this.pageItems.length : 0;
165-
if (!pageScroll ? ++this.step + this.maxItems > length : ++this.step * this.maxItems >= length) {
165+
const maxItemsPage = this.config.card === 'cardEntities' ? this.maxItems : this.maxItems / 2;
166+
if (!pageScroll ? ++this.step + this.maxItems > length : ++this.step * maxItemsPage + maxItemsPage >= length) {
166167
this.step--;
167168
this.panel.navigation.goRight();
168169
} else {
@@ -189,7 +190,10 @@ export class PageMenu extends Page {
189190
if (this.step <= 0) {
190191
left = this.panel.navigation.buildNavigationString('left');
191192
}
192-
if (!pageScroll ? this.step + this.maxItems >= length : (this.step + 1) * this.maxItems >= length) {
193+
const maxItemsPage = this.config.card === 'cardEntities' ? this.maxItems : this.maxItems / 2;
194+
if (
195+
!pageScroll ? this.step + this.maxItems >= length : (this.step + 1) * maxItemsPage + maxItemsPage >= length
196+
) {
193197
right = this.panel.navigation.buildNavigationString('right');
194198
}
195199
if (!left) {

0 commit comments

Comments
 (0)