Skip to content

Updating Platform Accessories does nothing - method is not implemented #3762

@justjam2013

Description

@justjam2013

Analysis

It is not possible to update platform accessories because the method handleUpdatePlatformAccessories() is not properly implemented:

https://github.com/homebridge/homebridge/blob/c25b3827a8ad2433083e93f3839255500d7478b1/src/bridgeService.ts#L388C3-L391

  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  handleUpdatePlatformAccessories(accessories: PlatformAccessory[]): void {
    // Update persisted accessories
    this.saveCachedPlatformAccessoriesOnDisk();
  }

In this method, the array of PlatformAccessory objects is lost, as it is not used in the handleUpdatePlatformAccessories() method. The method just saves the currently cached platform accessories back to disc without updating anything.

Even worse, the method is commented with a sweep-issues-under-the-rug annotation:

  // eslint-disable-next-line @typescript-eslint/no-unused-vars

Expected Behavior

handleUpdatePlatformAccessories() should take the passed in array of PlatformAccessory objects and update the appropriate cached accessories before saving them back to disk.

Steps To Reproduce

N/A

Logs

N/A

Configuration

N/A

Environment

  • OS: N/A
  • Homebridge: 1.8.5
  • Node: N/A
  • npm: N/A

Process Supervisor

not applicable

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions