generated from K-FOSS/TS-Core-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Locate Command & Better SmartHomeController types
- Loading branch information
Showing
12 changed files
with
162 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// src/Modules/Command/Commands/TimerStartCommand.ts | ||
import { BaseComamnd, CommandType } from '../BaseCommand'; | ||
|
||
/** | ||
* Locate the Device | ||
* | ||
* https://developers.google.com/assistant/smarthome/traits/locator#device-commands | ||
*/ | ||
export class LocateCommand extends BaseComamnd { | ||
public type = CommandType.Locate as const; | ||
|
||
/** | ||
* For use on devices that make an audible response on Locate and report information. If set to true, should silence an already in-progress alarm if one is occurring. | ||
*/ | ||
public silence: boolean; | ||
|
||
/** | ||
* Default is "en". Current language of query/display, | ||
* for return of localized location strings if needed | ||
*/ | ||
public lang: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// src/Modules/Trait/Traits/LocatorTrait.ts | ||
import { BaseTrait } from '../BaseTrait'; | ||
import { TraitType } from '../TraitType'; | ||
import { LocateCommand } from '../../Command/Commands/LocateCommand'; | ||
|
||
interface Attributes {} | ||
|
||
/** | ||
* This trait is used for devices that can be "found". This includes phones, robots | ||
* (including vacuums and mowers), drones, and tag-specific products that attach to other devices. | ||
* Devices can be found via a local indicator (for example, beeping, ringing, flashing or shrieking). | ||
* Requests to Find my [device] result in the device attempting to indicate its location. | ||
* | ||
* https://developers.google.com/assistant/smarthome/traits/locator | ||
*/ | ||
export class LocatorTrait extends BaseTrait { | ||
public type = TraitType.Locator; | ||
|
||
public attributes: Attributes; | ||
|
||
public commands = [new LocateCommand()] as const; | ||
|
||
/** | ||
* Set to true if an alert (audible or visible) was successfully generated on the device. | ||
*/ | ||
public generatedAlert?: boolean; | ||
} |