Skip to content

Commit

Permalink
sync up with other plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker committed Nov 1, 2024
1 parent 0842172 commit a18bf50
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
3 changes: 0 additions & 3 deletions .github/auto-merge.yml

This file was deleted.

6 changes: 3 additions & 3 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
"functionBody": "return (model.devices && model.devices[arrayIndices].ipaddress);"
}
},
"delete": {
"hide_device": {
"title": "Delete Device",
"type": "boolean",
"description": "DO NOT USE, UNLESS YOU WANT TO DELETE THIS DEVICE FROM CACHE.",
Expand Down Expand Up @@ -304,6 +304,7 @@
"devices[].configDeviceName",
"devices[].ipaddress",
"devices[].password",
"devices[].hide_device",
"devices[].external",
"devices[].showRainSensor",
"devices[].showValveSensor",
Expand All @@ -322,8 +323,7 @@
"devices[].showRequestResponse",
"devices[].firmware",
"devices[].refreshRate",
"devices[].logging",
"devices[].delete"
"devices[].logging"
]
}
]
Expand Down
26 changes: 13 additions & 13 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {

if (existingAccessory) {
// the accessory already exists
if (!device.delete) {
if (!device.hide_device) {
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName}`)

// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
Expand All @@ -251,7 +251,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {
} else {
this.unregisterPlatformAccessories(existingAccessory)
}
} else if (!device.delete) {
} else if (!device.hide_device) {
// the accessory does not yet exist, so we need to create it
this.infoLog(`Adding new accessory: ${rainbird!.model}`)

Expand Down Expand Up @@ -294,7 +294,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {

if (existingAccessory) {
// the accessory already exists
if (!device.delete && device.showRainSensor) {
if (!device.hide_device && device.showRainSensor) {
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName}`)

// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
Expand All @@ -313,7 +313,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {
} else {
this.unregisterPlatformAccessories(existingAccessory)
}
} else if (!device.delete && device.showRainSensor) {
} else if (!device.hide_device && device.showRainSensor) {
// the accessory does not yet exist, so we need to create it
this.infoLog(`Adding new accessory: ${model}`)

Expand Down Expand Up @@ -361,7 +361,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {
const irrigationAccessory = this.accessories.find(accessory => accessory.UUID === irrigationUuid)

const includeZones = device.includeZones!.split(',').map(Number)
const registerZoneValve = !device.delete
const registerZoneValve = !device.hide_device
&& device.showZoneValve
&& (includeZones.includes(0) || includeZones.includes(zoneId))

Expand Down Expand Up @@ -440,7 +440,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {

if (existingAccessory) {
// the accessory already exists
if (!device.delete && device.showValveSensor) {
if (!device.hide_device && device.showValveSensor) {
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName}`)

// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
Expand All @@ -460,7 +460,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {
} else {
this.unregisterPlatformAccessories(existingAccessory)
}
} else if (!device.delete && device.showValveSensor) {
} else if (!device.hide_device && device.showValveSensor) {
// the accessory does not yet exist, so we need to create it
this.infoLog(`Adding new accessory: ${model}`)

Expand Down Expand Up @@ -514,7 +514,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {

if (existingAccessory) {
// the accessory already exists
if (!device.delete && showProgramSwitch) {
if (!device.hide_device && showProgramSwitch) {
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName}`)

// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
Expand All @@ -534,7 +534,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {
} else {
this.unregisterPlatformAccessories(existingAccessory)
}
} else if (!device.delete && showProgramSwitch) {
} else if (!device.hide_device && showProgramSwitch) {
// the accessory does not yet exist, so we need to create it
this.infoLog(`Adding new accessory: ${model}`)

Expand Down Expand Up @@ -578,7 +578,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {

if (existingAccessory) {
// the accessory already exists
if (!device.delete && device.showStopIrrigationSwitch) {
if (!device.hide_device && device.showStopIrrigationSwitch) {
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName}`)

// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
Expand All @@ -597,7 +597,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {
} else {
this.unregisterPlatformAccessories(existingAccessory)
}
} else if (!device.delete && device.showStopIrrigationSwitch) {
} else if (!device.hide_device && device.showStopIrrigationSwitch) {
// the accessory does not yet exist, so we need to create it
this.infoLog(`Adding new accessory: ${model}`)

Expand Down Expand Up @@ -640,7 +640,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {

if (existingAccessory) {
// the accessory already exists
if (!device.delete && device.showDelayIrrigationSwitch) {
if (!device.hide_device && device.showDelayIrrigationSwitch) {
this.infoLog(`Restoring existing accessory from cache: ${existingAccessory.displayName}`)

// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
Expand All @@ -659,7 +659,7 @@ export class RainbirdPlatform implements DynamicPlatformPlugin {
} else {
this.unregisterPlatformAccessories(existingAccessory)
}
} else if (!device.delete && device.showDelayIrrigationSwitch) {
} else if (!device.hide_device && device.showDelayIrrigationSwitch) {
// the accessory does not yet exist, so we need to create it
this.infoLog(`Adding new accessory: ${model}`)

Expand Down
1 change: 0 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export interface DevicesConfig {
updateRate?: number
pushRate?: number
logging?: string
delete?: boolean
}

export interface options {
Expand Down

0 comments on commit a18bf50

Please sign in to comment.