File tree Expand file tree Collapse file tree 4 files changed +21
-3
lines changed Expand file tree Collapse file tree 4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " homebridge-roomba2 " : minor
3
+ ---
4
+
5
+ Added support for Identify method (supported in 3rd party HomeKit apps)
Original file line number Diff line number Diff line change 20
20
- Roomba docked notification
21
21
- Roomba running notification
22
22
- Roomba bin full notification
23
+ - Find Roomba (Identify Function, supported in 3rd Party HomeKit apps)
23
24
24
25
The homebridge-roomba2 plugin polls Roomba for its status when requested by HomeKit, so when you first open
25
26
the Home app you may see an old status, or no status, until Roomba has had time to respond (which may take
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
170
170
171
171
this . accessoryInfo . setCharacteristic ( Characteristic . Manufacturer , "iRobot" ) ;
172
172
this . accessoryInfo . setCharacteristic ( Characteristic . SerialNumber , this . serialnum ) ;
173
- this . accessoryInfo . setCharacteristic ( Characteristic . Identify , false ) ;
173
+ this . accessoryInfo . setCharacteristic ( Characteristic . Identify , true ) ;
174
174
this . accessoryInfo . setCharacteristic ( Characteristic . Name , this . name ) ;
175
175
this . accessoryInfo . setCharacteristic ( Characteristic . Model , this . model ) ;
176
176
this . accessoryInfo . setCharacteristic ( Characteristic . FirmwareRevision , version ) ;
@@ -222,8 +222,18 @@ export default class RoombaAccessory implements AccessoryPlugin {
222
222
this . startLongWatch ( ) ;
223
223
}
224
224
225
- public identify ( ) : void {
226
- this . log . debug ( "Identify requested. Not supported yet." ) ;
225
+ public identify ( ) {
226
+ this . log ( "Identify requested" ) ;
227
+ this . connect ( async ( error , roomba ) => {
228
+ if ( error || ! roomba ) {
229
+ return ;
230
+ }
231
+ try {
232
+ await roomba . find ( ) ;
233
+ } catch ( error ) {
234
+ this . log ( "Roomba failed to locate: %s" , ( error as Error ) . message ) ;
235
+ }
236
+ } ) ;
227
237
}
228
238
229
239
public getServices ( ) : Service [ ] {
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ declare module "dorita980" {
12
12
stop ( ) : Promise < CommandResult >
13
13
end ( ) : Promise < CommandResult >
14
14
dock ( ) : Promise < CommandResult >
15
+ find ( ) : Promise < CommandResult >
15
16
getRobotState ( states : string [ ] ) : Promise < RobotState >
16
17
}
17
18
@@ -44,6 +45,7 @@ declare module "dorita980" {
44
45
public stop ( ) : Promise < CommandResult >
45
46
public end ( ) : Promise < CommandResult >
46
47
public dock ( ) : Promise < CommandResult >
48
+ public find ( ) : Promise < CommandResult >
47
49
public getRobotState ( states : string [ ] ) : Promise < RobotState >
48
50
}
49
51
}
You can’t perform that action at this time.
0 commit comments