Merge pull request #207 from icanos/feature/include-all-outputs
Change behavior to add all devices to Home Assistant, whether they are hidden in the Plejd app or not
This commit is contained in:
commit
6427101542
5 changed files with 2 additions and 37 deletions
|
|
@ -49,13 +49,6 @@ class DeviceRegistry {
|
|||
|
||||
/** @param outputDevice {import('types/DeviceRegistry').OutputDevice} */
|
||||
addOutputDevice(outputDevice) {
|
||||
if (outputDevice.hiddenFromIntegrations || outputDevice.hiddenFromRoomList) {
|
||||
logger.verbose(`Device ${outputDevice.name} is hidden and will not be included.
|
||||
Hidden from room list: ${outputDevice.hiddenFromRoomList}
|
||||
Hidden from integrations: ${outputDevice.hiddenFromIntegrations}`);
|
||||
return;
|
||||
}
|
||||
|
||||
this.outputDevices = {
|
||||
...this.outputDevices,
|
||||
[outputDevice.uniqueId]: outputDevice,
|
||||
|
|
|
|||
|
|
@ -444,8 +444,6 @@ class PlejdApi {
|
|||
bleOutputAddress,
|
||||
deviceId: device.deviceId,
|
||||
dimmable,
|
||||
hiddenFromRoomList: device.hiddenFromRoomList,
|
||||
hiddenFromIntegrations: device.hiddenFromIntegrations,
|
||||
name: device.title,
|
||||
output: deviceOutput,
|
||||
roomId: device.roomId,
|
||||
|
|
@ -518,8 +516,6 @@ class PlejdApi {
|
|||
bleOutputAddress: roomAddress,
|
||||
deviceId: null,
|
||||
dimmable,
|
||||
hiddenFromRoomList: false,
|
||||
hiddenFromIntegrations: false,
|
||||
name: room.title,
|
||||
output: undefined,
|
||||
roomId: undefined,
|
||||
|
|
@ -540,7 +536,7 @@ class PlejdApi {
|
|||
_getSceneDevices() {
|
||||
this.deviceRegistry.clearSceneDevices();
|
||||
// add scenes as switches
|
||||
const scenes = this.siteDetails.scenes.filter((x) => x.hiddenFromSceneList === false);
|
||||
const scenes = [...this.siteDetails.scenes];
|
||||
|
||||
scenes.forEach((scene) => {
|
||||
const sceneNum = this.siteDetails.sceneIndex[scene.sceneId];
|
||||
|
|
@ -549,7 +545,6 @@ class PlejdApi {
|
|||
bleOutputAddress: sceneNum,
|
||||
deviceId: undefined,
|
||||
dimmable: false,
|
||||
hiddenFromSceneList: scene.hiddenFromSceneList,
|
||||
name: scene.title,
|
||||
output: undefined,
|
||||
roomId: undefined,
|
||||
|
|
|
|||
|
|
@ -17,9 +17,7 @@ class SceneManager {
|
|||
}
|
||||
|
||||
init() {
|
||||
const scenes = this.deviceRegistry
|
||||
.getApiSite()
|
||||
.scenes.filter((x) => x.hiddenFromSceneList === false);
|
||||
const scenes = [...this.deviceRegistry.getApiSite().scenes];
|
||||
|
||||
this.scenes = {};
|
||||
scenes.forEach((scene) => {
|
||||
|
|
|
|||
3
plejd/types/DeviceRegistry.d.ts
vendored
3
plejd/types/DeviceRegistry.d.ts
vendored
|
|
@ -7,9 +7,6 @@ export interface OutputDevice {
|
|||
deviceId: string;
|
||||
dim?: number;
|
||||
dimmable: boolean;
|
||||
hiddenFromRoomList?: boolean;
|
||||
hiddenFromIntegrations?: boolean;
|
||||
hiddenFromSceneList?: boolean;
|
||||
name: string;
|
||||
output: number;
|
||||
roomId: string | undefined;
|
||||
|
|
|
|||
18
plejd/types/Mqtt.d.ts
vendored
18
plejd/types/Mqtt.d.ts
vendored
|
|
@ -5,21 +5,3 @@ export type TOPIC_TYPES = { [key: string]: TopicType };
|
|||
|
||||
export type MqttType = 'light' | 'scene' | 'switch' | 'device_automation';
|
||||
export type MQTT_TYPES = { [key: string]: MqttType };
|
||||
|
||||
export interface OutputDevice {
|
||||
bleOutputAddress: number;
|
||||
deviceId: string;
|
||||
dim?: number;
|
||||
dimmable: boolean;
|
||||
hiddenFromRoomList?: boolean;
|
||||
hiddenFromIntegrations?: boolean;
|
||||
hiddenFromSceneList?: boolean;
|
||||
name: string;
|
||||
output: number;
|
||||
roomId: string;
|
||||
state: boolean | undefined;
|
||||
type: string;
|
||||
typeName: string;
|
||||
version: string;
|
||||
uniqueId: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue