minor restructuring

This commit is contained in:
Luis Riegger 2021-05-10 09:53:47 +02:00
parent 969f843662
commit 0d54f15382
5 changed files with 10 additions and 6 deletions

View File

@ -55,7 +55,7 @@
"type": "string",
"enum": [
"clean",
"cleanThe",
"cleanZone",
"cleanSpot",
"goToDock",
"dockState",
@ -84,7 +84,7 @@
},
"default": [
"clean",
"cleanThe",
"cleanZone",
"goToDock",
"dockState",
"binFull",

View File

@ -131,11 +131,11 @@ export class KoboldVacuumRobotAccessory
setCharacteristicHandler: this.setGoToDock
}]);
this.dockStateService = this.registerService(RobotService.DOCKED, this.platform.Service.OccupancySensor, [{
characteristic: this.platform.Characteristic.OccupancyDetected,
characteristic: this.platform.Characteristic.OccupancyDetected.OccupancyDetected,
getCharacteristicHandler: this.getDocked,
}]);
this.binFullService = this.registerService(RobotService.BIN_FULL, this.platform.Service.OccupancySensor, [{
characteristic: this.platform.Characteristic.OccupancyDetected,
characteristic: this.platform.Characteristic.OccupancyDetected.OccupancyDetected,
getCharacteristicHandler: this.getBinFull,
}]);
this.findMeService = this.registerService(RobotService.FIND_ME, this.platform.Service.Switch, [{
@ -240,7 +240,7 @@ export class KoboldVacuumRobotAccessory
service = this.accessory.addService(serviceType, displayName, serviceName);
}
characteristicHandlers.forEach(ch => {
const char = service.getCharacteristic(ch.characteristic)
var char = service.getCharacteristic(ch.characteristic)
if (ch.getCharacteristicHandler) {char.onGet(ch.getCharacteristicHandler)}
if (ch.setCharacteristicHandler) {char.onSet(ch.setCharacteristicHandler)}
});

View File

@ -40,7 +40,6 @@ export class HomebridgeKoboldPlatform implements DynamicPlatformPlugin
discoverRobots()
{
const client = new KoboldApi.Client();
this.log.debug("blub");
try
{
@ -126,6 +125,7 @@ export class HomebridgeKoboldPlatform implements DynamicPlatformPlugin
try
{
robot.meta = state.meta;
robot.availableServices = state.availableServices;
// Update existing robot accessor
if (cachedRobot)

View File

@ -7,6 +7,7 @@ export enum availableLocales {
const localizationDicts = {
'en': {
"clean": "Clean",
"cleanZone": "Clean Zone",
"cleanThe": "Clean the",
"goToDock": "Go to Dock",
"dockState": "Docked",
@ -21,6 +22,7 @@ const localizationDicts = {
},
'de': {
"clean": "Sauge",
"cleanZone": "Sauge Zone",
"cleanThe": "Sauge",
"goToDock": "Zur Basis",
"dockState": "In der Basis",
@ -35,6 +37,7 @@ const localizationDicts = {
},
'fr': {
"clean": "Aspirer",
"cleanZone": "Aspirer Zone",
"cleanThe": "Aspirer",
"goToDock": "Retour à la base",
"dockState": "Sur la base",

View File

@ -6,6 +6,7 @@ export enum CleanType {
export enum RobotService {
CLEAN = "clean",
CLEAN_SPOT = "cleanSpot",
CLEAN_ZONE = "cleanZone",
GO_TO_DOCK = "goToDock",
DOCKED = "dockState",
BIN_FULL = "binFull",