athombv / homey-web-api-issues

This issue tracker is for Homey Developers using the Web API.
4 stars 1 forks source link

[TypeScript] `DeviceCapability.setValue` type error (`opts` not optional) #27

Closed OlivierZal closed 1 year ago

OlivierZal commented 1 year ago

Since opts means options, this parameter should be optional, so

export class DeviceCapability  {
  value: boolean | number | string | null;
  lastChanged: Date | null;
  destroy(): any;
  setValue(
    value: boolean | number | string,
    opts: object,
  ): Promise<any>;
}

should rather be:

export class DeviceCapability  {
  value: boolean | number | string | null;
  lastChanged: Date | null;
  destroy(): any;
  setValue(
    value: boolean | number | string,
    opts?: object,
  ): Promise<any>;
}
jeroenwienk commented 1 year ago

Fixed in 3.0.7

OlivierZal commented 1 year ago

Confirmed