PropertyType.SCENE

This commit is contained in:
Patrick Haßel 2021-11-04 13:51:26 +01:00
parent d8ad608afa
commit 0cf463fc4a
3 changed files with 10 additions and 4 deletions

View File

@ -21,6 +21,7 @@
<option value="ON_OFF">An / Aus</option> <option value="ON_OFF">An / Aus</option>
<option value="PERCENT">Prozent</option> <option value="PERCENT">Prozent</option>
<option value="SHUTTER">Rollladen</option> <option value="SHUTTER">Rollladen</option>
<option value="SCENE">Szene</option>
</select> </select>
</td> </td>
</tr> </tr>
@ -144,6 +145,11 @@
<option *ngFor="let _ of [].constructor(21); let value = index" [ngValue]="value * 5">{{value * 5}}%</option> <option *ngFor="let _ of [].constructor(21); let value = index" [ngValue]="value * 5">{{value * 5}}%</option>
</select> </select>
</td> </td>
<td *ngIf="schedule.propertyType === 'SCENE'">
<select [(ngModel)]="entry.value" (ngModelChange)="set(entry, 'value', entry.value)">
<option *ngFor="let _ of [].constructor(64); let value = index" [ngValue]="value + 1">{{value + 1}}</option>
</select>
</td>
<td *ngIf="schedule.propertyType === 'SHUTTER'" [class.true]="entry.value === 0" [class.false]="entry.value === 100" [class.tristate]="0 < entry.value && entry.value < 100"> <td *ngIf="schedule.propertyType === 'SHUTTER'" [class.true]="entry.value === 0" [class.false]="entry.value === 100" [class.tristate]="0 < entry.value && entry.value < 100">
<select [(ngModel)]="entry.value" (ngModelChange)="set(entry, 'value', entry.value)"> <select [(ngModel)]="entry.value" (ngModelChange)="set(entry, 'value', entry.value)">
<option [ngValue]="0">100% Offen</option> <option [ngValue]="0">100% Offen</option>

View File

@ -67,7 +67,7 @@ public class DemoDataService {
final KnxGroupDto helligkeit = createKnxGroupIfNotExists("Helligkeit", 0, 5, 6, "9.004", PropertyType.LUX, false, true); final KnxGroupDto helligkeit = createKnxGroupIfNotExists("Helligkeit", 0, 5, 6, "9.004", PropertyType.LUX, false, true);
final KnxGroupDto szene_haus = createKnxGroupIfNotExists("Szene Haus", 0, 0, 21, "17.004", PropertyType.LUX, false, true); final KnxGroupDto szene_haus = createKnxGroupIfNotExists("Szene Haus", 0, 0, 21, "17.004", PropertyType.SCENE, false, true);
if (deviceRepository.count() == 0) { if (deviceRepository.count() == 0) {
createDeviceSwitch("Ambiente EG", ambiente_eg_status.getProperty(), ambiente_eg_schalten.getProperty()); createDeviceSwitch("Ambiente EG", ambiente_eg_status.getProperty(), ambiente_eg_schalten.getProperty());
@ -131,10 +131,10 @@ public class DemoDataService {
scheduleRepository.save(scheduleBadLichtMitte); scheduleRepository.save(scheduleBadLichtMitte);
final Schedule scheduleSzeneHaus = createSchedule(true, "Dekoration", szene_haus.getProperty()); final Schedule scheduleSzeneHaus = createSchedule(true, "Dekoration", szene_haus.getProperty());
createSunrise(scheduleSzeneHaus, true, Zenith.ASTRONOMICAL, 0, 31); createTime(scheduleSzeneHaus, true, 6, 0, 0, 0, 31);
createTime(scheduleSzeneHaus, true, 8, 30, 0, 0, 30); createTime(scheduleSzeneHaus, true, 8, 30, 0, 0, 30);
createSunset(scheduleSzeneHaus, true, Zenith.OFFICIAL, 0, 31); createSunset(scheduleSzeneHaus, true, Zenith.OFFICIAL, 0, 31);
createSunset(scheduleSzeneHaus, true, Zenith.ASTRONOMICAL, 0, 30); createTime(scheduleSzeneHaus, true, 22, 0, 0, 0, 30);
scheduleRepository.save(scheduleSzeneHaus); scheduleRepository.save(scheduleSzeneHaus);
} }
} }

View File

@ -1,5 +1,5 @@
package de.ph87.homeautomation.property; package de.ph87.homeautomation.property;
public enum PropertyType { public enum PropertyType {
ON_OFF, PERCENT, SHUTTER, LUX ON_OFF, PERCENT, SHUTTER, LUX, SCENE
} }