generated from custom-cards/boilerplate-card
-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Closes #1863 --------- Co-authored-by: Ilya Rakhlin <i.rakhlin@gmail.com>
- Loading branch information
1 parent
a6ecb76
commit 43947b4
Showing
4 changed files
with
70 additions
and
24 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
export const isCompanionApp = (userAgent: string): boolean => { | ||
return !!userAgent.match(/Home ?Assistant/); | ||
}; | ||
|
||
export const isAndroidCompanionApp = (userAgent: string): boolean => { | ||
return !!userAgent.match(/(?=.*Home ?Assistant)(?=.*Android)/); | ||
}; | ||
|
||
export const isIOSCompanionApp = (userAgent: string): boolean => { | ||
return !!userAgent.match(/(?=.*Home ?Assistant)(?=.*iOS)/); | ||
}; |
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