Created
January 12, 2017 19:33
-
-
Save EddyVerbruggen/405fe6a03644128f8173c431a7be2cd9 to your computer and use it in GitHub Desktop.
NativeScript HomeKit - adding rooms
This file contains hidden or 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
// the home you created earlier | |
let homeName = home.name; | |
// ask the user for a name and add it to HomeKit | |
prompt(`Name the room to add to ${homeName}`).then((promptResult: PromptResult) => { | |
if (promptResult.result) { | |
homekit.addRoomToHome(promptResult.text, homeName).then( | |
(room: Room) => console.log(`Added room ${room.name} to home ${homeName}`), | |
err => alert(err) | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment