Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinclair81 committed Nov 19, 2023
1 parent 51c749f commit 4765599
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 33 deletions.
10 changes: 9 additions & 1 deletion src/accessories/otherPlatformAccessory.ts
Expand Up @@ -31,7 +31,10 @@ export class OtherPlatformAccessory implements AccessoryPlugin {

this.errorCheck();

this.service = new this.api.hap.Service.Other(this.device.name);
this.service = new this.api.hap.Service.ServiceLabel(this.device.name);

this.service.getCharacteristic(this.platform.Characteristic.ServiceLabelNamespace)
.onGet(this.getServiceLabelNamespace.bind(this));

this.information = new this.api.hap.Service.AccessoryInformation()
.setCharacteristic(this.api.hap.Characteristic.Manufacturer, this.platform.manufacturer)
Expand All @@ -51,4 +54,9 @@ export class OtherPlatformAccessory implements AccessoryPlugin {
return this.services;
}

async getServiceLabelNamespace(): Promise<CharacteristicValue> {
// validValues: [0, 1],
return 0;
}

}
39 changes: 7 additions & 32 deletions src/platform.ts
Expand Up @@ -8,38 +8,7 @@ HDMI Pi:
Homebridge v1.7.0 (HAP v0.11.1)
NPM v10.2.3
NODE v20.5.1 -> Homebridge requires Node.js version of ^18.15.0 || ^20.7.0 which does not satisfy the current Node.js version of v20.5.1. You may need to upgrade your installation of Node.js - see https://homebridge.io/w/JTKEF
{
"platform": "LogoPlatform",
"name": "LOGO 8",
"interface": "snap7",
"ip": "192.168.1.169",
"logoType": "0BA1",
"localTSAP": "0x2700",
"remoteTSAP": "0x2600",
"updateInterval": 10000,
"debugMsgLog": 1,
"devices": [
{
"name": "Test 1",
"type": "blind",
"blindConvertValue": 1,
"blindSetTargetPos": "VW600",
"blindGetTargetPos": "VW758",
"blindGetPos": "VW758",
"blindGetState": "VW821"
},
{
"name": "Test 2",
"type": "blind",
"blindConvertValue": 1,
"blindSetTargetPos": "VW32",
"blindGetTargetPos": "VW34",
"blindGetPos": "VW34",
"blindGetState": "VW36"
}
]
},
*/

import { API, AccessoryPlugin, Service, Characteristic, StaticPlatformPlugin, Logging, PlatformConfig } from "homebridge";
Expand All @@ -64,6 +33,7 @@ import { ValvePlatformAccessory } from './accessories/valvePlatformA
import { FanPlatformAccessory } from './accessories/fanPlatformAccessory';
import { FilterMaintenancePlatformAccessory } from './accessories/filterMaintenancePlatformAccessory';
import { OutletPlatformAccessory } from './accessories/outletPlatformAccessory';
import { OtherPlatformAccessory } from './accessories/otherPlatformAccessory';

import { LightSensorPlatformAccessory } from './sensors/lightSensorPlatformAccessory';
import { MotionSensorPlatformAccessory } from './sensors/motionSensorPlatformAccessory';
Expand Down Expand Up @@ -263,6 +233,11 @@ export class LogoHomebridgePlatform implements StaticPlatformPlugin {
this.accessoriesArray.push( new OutletPlatformAccessory(this.api, this, device) );
this.queueMinSize += 1;
break;

case "other":
this.accessoriesArray.push( new OtherPlatformAccessory(this.api, this, device) );
this.queueMinSize += 1;
break;

default:
this.accessoriesArray.push( new SwitchPlatformAccessory(this.api, this, device) );
Expand Down

0 comments on commit 4765599

Please sign in to comment.