Skip to content

Commit

Permalink
#6 More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
theimo1221 committed Nov 14, 2021
1 parent 2a9503f commit b738cbf
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/models/rooms/RoomSettings/roomDeviceAddingSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class RoomDeviceAddingSettings {
this.devices[deviceType] = [];
}
if (customName === undefined) {
customName = `${this.RoomName} ${deviceTypeName}`;
customName = `${this.RoomName} ${DeviceType[deviceType]}`;
}
this.devices[deviceType][index] = new RoomAddDeviceItem(setID, index, customName);
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/devices/Griffe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export class Griffe {

public static getAllGriffe(): HmIpGriff[] {
const griffe: HmIpGriff[] = [];
for (const dID in Devices.hmIP) {
const d = Devices.hmIP[dID];
for (const dID in Devices.alLDevices) {
const d = Devices.alLDevices[dID];
if (d.deviceType === DeviceType.HmIpGriff) {
griffe.push(d as HmIpGriff);
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/devices/Heizgruppen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export class Heizgruppen {

public static getAllGruppen(): HmIpHeizgruppe[] {
const gruppen: HmIpHeizgruppe[] = [];
for (const dID in Devices.hmIP) {
const d = Devices.hmIP[dID];
for (const dID in Devices.alLDevices) {
const d = Devices.alLDevices[dID];
if (d.deviceType === DeviceType.HmIpHeizgruppe) {
gruppen.push(d as HmIpHeizgruppe);
}
Expand All @@ -79,8 +79,8 @@ export class Heizgruppen {
}

public static getSpecificGroup(name: string): HmIpHeizgruppe | undefined {
for (const dID in Devices.hmIP) {
const d = Devices.hmIP[dID];
for (const dID in Devices.alLDevices) {
const d = Devices.alLDevices[dID];
if (d.deviceType === DeviceType.HmIpHeizgruppe && d.info.customName === name) {
return d as HmIpHeizgruppe;
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/devices/IoBrokerBaseDevice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export abstract class IoBrokerBaseDevice {
}

public room: RoomBase | undefined = undefined;
public allDevicesKey: string;
public allDevicesKey: string = '';
protected _ioConnection?: IOBrokerConnection;

protected constructor(protected _info: DeviceInfo, public deviceType: DeviceType) {
Expand Down
4 changes: 2 additions & 2 deletions src/server/devices/Rollos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export class Rolladen {

public static getAllRollos(): HmIpRoll[] {
const rollos: HmIpRoll[] = [];
for (const dID in Devices.hmIP) {
const d = Devices.hmIP[dID];
for (const dID in Devices.alLDevices) {
const d = Devices.alLDevices[dID];
if (d.deviceType === DeviceType.HmIpRoll) {
rollos.push(d as HmIpRoll);
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/devices/hmIPDevices/hmIpHeizgruppe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ export class HmIpHeizgruppe extends HmIPDevice {

public getBelongingHeizungen(): HmIpHeizung[] {
const result: HmIpHeizung[] = [];
for (const dID in Devices.hmIP) {
const d = Devices.hmIP[dID];
for (const dID in Devices.alLDevices) {
const d = Devices.alLDevices[dID];
if (d.deviceType === DeviceType.HmIpHeizung && d.info.room === this.info.room) {
result.push(d as HmIpHeizung);
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/services/Telegram/telegram-Commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ export class TelegramCommands {
/\/set_vibration_sensitivity/,
async (m: TelegramBot.Message): Promise<boolean> => {
if (m.from === undefined) return false;
for (const id in Devices.Zigbee) {
const d = Devices.Zigbee[id];
for (const id in Devices.alLDevices) {
const d = Devices.alLDevices[id];
if (d.deviceType === DeviceType.ZigbeeAquaraVibra) {
(d as ZigbeeAquaraVibra).setSensitivity(2);
}
Expand All @@ -202,8 +202,8 @@ export class TelegramCommands {
async (m: TelegramBot.Message): Promise<boolean> => {
if (m.from === undefined) return false;
const response: string[] = ['These are the assignments for all buttons'];
for (const id in Devices.hmIP) {
const d = Devices.hmIP[id];
for (const id in Devices.alLDevices) {
const d = Devices.alLDevices[id];
if (d.deviceType === DeviceType.HmIpTaster) {
response.push((d as HmIpTaster).getTastenAssignment());
}
Expand Down

0 comments on commit b738cbf

Please sign in to comment.