Skip to content

Commit d0ddb5f

Browse files
committed
refactor(dingz): remove unnecessary code
- blinds will never be added without an id - remove this unnecessary code
1 parent 472e703 commit d0ddb5f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/dingzAccessory.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -790,10 +790,8 @@ export class DingzAccessory extends DingzDaBaseAccessory {
790790
}
791791

792792
// Add WindowCovering (Blinds)
793-
private addWindowCoveringService(name: string, id?: WindowCoveringId) {
794-
let service: Service;
795-
if (id) {
796-
service =
793+
private addWindowCoveringService(name: string, id: WindowCoveringId) {
794+
const service: Service =
797795
this.accessory.getServiceById(
798796
this.platform.Service.WindowCovering,
799797
id.toString(),
@@ -803,11 +801,6 @@ export class DingzAccessory extends DingzDaBaseAccessory {
803801
`${name} B${id}`,
804802
id.toString(),
805803
);
806-
} else {
807-
service =
808-
this.accessory.getService(this.platform.Service.WindowCovering) ??
809-
this.accessory.addService(this.platform.Service.WindowCovering, name);
810-
}
811804
// each service must implement at-minimum the "required characteristics" for the given service type
812805
// see https://developers.homebridge.io/#/service/Lightbulb
813806

0 commit comments

Comments
 (0)