├── .github ├── main.png └── preferences.png ├── .artwork ├── app-icon.png └── app-icon.sketch ├── Home Assistant ├── Assets.xcassets │ ├── Contents.json │ └── AppIcon.appiconset │ │ ├── icon_16x16.png │ │ ├── icon_32x32.png │ │ ├── icon_128x128.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_256x256.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_512x512.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_256x256@2x.png │ │ ├── icon_512x512@2x.png │ │ └── Contents.json ├── PrefrencesWindowController.swift ├── BrwoserWindowController.swift ├── AppDelegate.swift ├── Utils.swift ├── Info.plist ├── BrowserViewController.swift ├── PrefrencesViewController.swift ├── PrefrencesManager.swift └── Base.lproj │ └── Main.storyboard ├── Home Assistant.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcuserdata │ └── reza.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── Home Assistant.xcscheme └── project.pbxproj ├── README.md ├── .gitignore └── LICENSE /.github/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/.github/main.png -------------------------------------------------------------------------------- /.artwork/app-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/.artwork/app-icon.png -------------------------------------------------------------------------------- /.artwork/app-icon.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/.artwork/app-icon.sketch -------------------------------------------------------------------------------- /.github/preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/.github/preferences.png -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_16x16.png -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_32x32.png -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_128x128.png -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_256x256.png -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_512x512.png -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moallemi/home-assistant-mac/HEAD/Home Assistant/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /Home Assistant.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Home Assistant/PrefrencesWindowController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Prefrences.swift 3 | // Home Assistant 4 | // 5 | // Created by Reza Moallemi on 9/16/17. 6 | // Copyright © 2017 Reza Moallemi. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class PrefrencesWindowController: NSWindowController { 12 | 13 | override func windowDidLoad() { 14 | super.windowDidLoad() 15 | 16 | window?.level = NSWindow.Level(rawValue: Int(CGWindowLevelForKey(.floatingWindow))) 17 | 18 | window?.delegate = contentViewController as? NSWindowDelegate 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Home Assistant.xcodeproj/xcuserdata/reza.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Home Assistant.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | F5F718DF1F6AB55300A40C98 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Home Assistant/BrwoserWindowController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BrwoserWindowController.swift 3 | // Home Assistant 4 | // 5 | // Created by Reza Moallemi on 9/17/17. 6 | // Copyright © 2017 Reza Moallemi. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class BrwoserWindowController: NSWindowController { 12 | 13 | override func windowDidLoad() { 14 | shouldCascadeWindows = false 15 | window?.setFrameAutosaveName(NSWindow.FrameAutosaveName(rawValue: "MainWindow")) 16 | 17 | window?.titlebarAppearsTransparent = true 18 | window?.backgroundColor = NSColor(hexString: "#03A9F4") 19 | 20 | super.windowDidLoad() 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Home Assistant/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Home Assistant 4 | // 5 | // Created by Reza Moallemi on 9/14/17. 6 | // Copyright © 2017 Reza Moallemi. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | func applicationDidFinishLaunching(_ aNotification: Notification) { 15 | // Insert code here to initialize your application 16 | } 17 | 18 | func applicationWillTerminate(_ aNotification: Notification) { 19 | // Insert code here to tear down your application 20 | } 21 | 22 | func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 23 | return true 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Home Assistant/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.swift 3 | // Home Assistant 4 | // 5 | // Created by Reza Moallemi on 9/23/17. 6 | // Copyright © 2017 Reza Moallemi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | extension NSColor { 13 | convenience init(hexString: NSString) { 14 | let hexString: NSString = hexString.trimmingCharacters(in: NSCharacterSet.whitespacesAndNewlines) as NSString 15 | let scanner = Scanner(string: hexString as String) 16 | 17 | if (hexString.hasPrefix("#")) { 18 | scanner.scanLocation = 1 19 | } 20 | 21 | var color:UInt32 = 0 22 | scanner.scanHexInt32(&color) 23 | 24 | let mask = 0x000000FF 25 | let r = Int(color >> 16) & mask 26 | let g = Int(color >> 8) & mask 27 | let b = Int(color) & mask 28 | 29 | let red = CGFloat(r) / 255.0 30 | let green = CGFloat(g) / 255.0 31 | let blue = CGFloat(b) / 255.0 32 | 33 | self.init(red:red, green:green, blue:blue, alpha:1) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Home Assistant/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | Copyright © 2017 Reza Moallemi. All rights reserved. 27 | NSMainStoryboardFile 28 | Main 29 | NSPrincipalClass 30 | NSApplication 31 | NSAppTransportSecurity 32 | 33 | NSAllowsArbitraryLoadsInWebContent 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### NOTE: This repo was archived due to release of official Home Assistant Mac app at https://github.com/home-assistant/iOS/releases 2 | 3 | # Home Assistant macOS App 4 | Are you tired of having a tab always open in your browser for [Home Assistant](https://home-assistant.io)? So this app is for you! 5 | 6 | ![](https://github.com/moallemi/home-assistant-mac/blob/master/.github/main.png?raw=true) 7 | 8 | You can set both local and global address of your home assistant and easily switch between them. 9 | ![](https://github.com/moallemi/home-assistant-mac/blob/master/.github/preferences.png?raw=true) 10 | 11 | ## Download 12 | You can download latest version from [here](https://github.com/moallemi/home-assistant-mac/releases) 13 | 14 | ## Install 15 | Just uncompress the zip file, run `HomeAssistant-x.x.x.dmg` and drag `Home Assistant.dmg` to your `Applications` folder. 16 | 17 | License 18 | ------- 19 | 20 | Licensed under the Apache License, Version 2.0 (the "License"); 21 | you may not use this file except in compliance with the License. 22 | You may obtain a copy of the License at 23 | 24 | http://www.apache.org/licenses/LICENSE-2.0 25 | 26 | Unless required by applicable law or agreed to in writing, software 27 | distributed under the License is distributed on an "AS IS" BASIS, 28 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 | See the License for the specific language governing permissions and 30 | limitations under the License. 31 | -------------------------------------------------------------------------------- /Home Assistant/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "icon_16x16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "icon_16x16@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "icon_32x32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "icon_32x32@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "icon_128x128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "icon_128x128@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "icon_256x256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "icon_256x256@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "icon_512x512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "icon_512x512@2x.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Home Assistant/BrowserViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Home Assistant 4 | // 5 | // Created by Reza Moallemi on 9/14/17. 6 | // Copyright © 2017 Reza Moallemi. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import WebKit 11 | 12 | class BrowserViewController: NSViewController, WKNavigationDelegate { 13 | 14 | @IBOutlet weak var webView: WKWebView! 15 | @IBOutlet weak var progressView: NSProgressIndicator! 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | webView.navigationDelegate = self 21 | webView.addObserver(self, forKeyPath: "loading", options: .new, context: nil) 22 | webView.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil) 23 | 24 | webView.load(URLRequest(url: URL(string: PreferenceManager.sharedInstance.defaultAddress)!)) 25 | } 26 | 27 | func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { 28 | progressView.doubleValue = 0.0 29 | } 30 | 31 | override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { 32 | if (keyPath == "estimatedProgress") { 33 | progressView.isHidden = webView.estimatedProgress == 1.0 34 | progressView.doubleValue = webView.estimatedProgress 35 | } 36 | } 37 | 38 | func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { 39 | showDialog(message: error.localizedDescription, info: "") 40 | } 41 | 42 | @IBAction func reloadPage(_ sender: AnyObject) { 43 | webView.load(URLRequest(url: URL(string: PreferenceManager.sharedInstance.defaultAddress)!)) 44 | } 45 | 46 | @IBAction func preferencesClicked(_ sender: AnyObject) { 47 | let mainStoryboard = NSStoryboard.init(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil) 48 | let myWindowController = mainStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: "preferences")) as! NSWindowController 49 | 50 | NSApplication.shared.runModal(for: myWindowController.window!) 51 | reloadPage(sender) 52 | myWindowController.close() 53 | } 54 | 55 | func showDialog(message: String, info: String) { 56 | let alert: NSAlert = NSAlert() 57 | alert.messageText = message 58 | alert.informativeText = info 59 | alert.alertStyle = NSAlert.Style.critical 60 | alert.addButton(withTitle: "OK") 61 | alert.beginSheetModal(for: view.window!, completionHandler: nil) 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/xcode,macos,swift 2 | 3 | ### Xcode ### 4 | # Xcode 5 | # 6 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 7 | 8 | ## Build generated 9 | build/ 10 | DerivedData/ 11 | UserInterfaceState.xcuserstate 12 | .idea 13 | 14 | ## Various settings 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata/ 24 | 25 | ## Other 26 | *.moved-aside 27 | *.xccheckout 28 | *.xcscmblueprint 29 | 30 | 31 | ### macOS ### 32 | *.DS_Store 33 | .AppleDouble 34 | .LSOverride 35 | 36 | # Icon must end with two \r 37 | Icon 38 | # Thumbnails 39 | ._* 40 | # Files that might appear in the root of a volume 41 | .DocumentRevisions-V100 42 | .fseventsd 43 | .Spotlight-V100 44 | .TemporaryItems 45 | .Trashes 46 | .VolumeIcon.icns 47 | .com.apple.timemachine.donotpresent 48 | # Directories potentially created on remote AFP share 49 | .AppleDB 50 | .AppleDesktop 51 | Network Trash Folder 52 | Temporary Items 53 | .apdisk 54 | 55 | 56 | ### Swift ### 57 | # Xcode 58 | # 59 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 60 | 61 | ## Build generated 62 | 63 | ## Various settings 64 | 65 | ## Other 66 | *.xcuserstate 67 | 68 | ## Obj-C/Swift specific 69 | *.hmap 70 | *.ipa 71 | *.dSYM.zip 72 | *.dSYM 73 | 74 | ## Playgrounds 75 | timeline.xctimeline 76 | playground.xcworkspace 77 | 78 | # Swift Package Manager 79 | # 80 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 81 | # Packages/ 82 | .build/ 83 | 84 | # CocoaPods 85 | # 86 | # We recommend against adding the Pods directory to your .gitignore. However 87 | # you should judge for yourself, the pros and cons are mentioned at: 88 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 89 | # 90 | # Pods/ 91 | 92 | # Carthage 93 | # 94 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 95 | # Carthage/Checkouts 96 | 97 | Carthage/Build 98 | 99 | # fastlane 100 | # 101 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 102 | # screenshots whenever they are needed. 103 | # For more information about the recommended setup visit: 104 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 105 | 106 | fastlane/report.xml 107 | fastlane/Preview.html 108 | fastlane/screenshots 109 | fastlane/test_output 110 | 111 | -------------------------------------------------------------------------------- /Home Assistant/PrefrencesViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PrefrencesViewController.swift 3 | // Home Assistant 4 | // 5 | // Created by Reza Moallemi on 9/17/17. 6 | // Copyright © 2017 Reza Moallemi. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class PrefrencesViewController: NSViewController, NSWindowDelegate { 12 | 13 | @IBOutlet weak var textFieldLocalAddress: NSTextField! 14 | @IBOutlet weak var textFieldGlobalAddress: NSTextField! 15 | @IBOutlet weak var comboDefaultAddress: NSComboBox! 16 | 17 | fileprivate let preferenceManager = PreferenceManager.sharedInstance 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | 22 | textFieldLocalAddress.stringValue = preferenceManager.localAddress 23 | textFieldGlobalAddress.stringValue = preferenceManager.globalAddress 24 | comboDefaultAddress.selectItem(at: preferenceManager.defaultAddressIndex) 25 | } 26 | 27 | override func viewWillDisappear() { 28 | super.viewWillDisappear() 29 | 30 | saveSettings() 31 | } 32 | 33 | func saveSettings() { 34 | preferenceManager.localAddress = textFieldLocalAddress.stringValue 35 | preferenceManager.globalAddress = textFieldGlobalAddress.stringValue 36 | preferenceManager.defaultAddressIndex = comboDefaultAddress.indexOfSelectedItem 37 | 38 | preferenceManager.synchronize() 39 | } 40 | 41 | func windowShouldClose(_ sender: NSWindow) -> Bool { 42 | let result = areSettingsValid() 43 | if result { 44 | NSApplication.shared.stopModal() 45 | } 46 | return result 47 | } 48 | 49 | func areSettingsValid() -> Bool { 50 | if comboDefaultAddress.indexOfSelectedItem == 0 && !validUrl(textFieldLocalAddress.stringValue) { 51 | showDialog(message: "Invalid Local Address!", info: "Please check local url address again") 52 | return false 53 | } 54 | if comboDefaultAddress.indexOfSelectedItem == 1 && !validUrl(textFieldGlobalAddress.stringValue) { 55 | showDialog(message: "Invalid Global Address!", info: "Please check global url address again") 56 | return false 57 | } 58 | return true 59 | } 60 | 61 | func validUrl(_ urlString: String?) -> Bool { 62 | let url: NSURL? = NSURL(string: urlString!) 63 | 64 | if url != nil && urlString?.characters.count != 0 { 65 | return true 66 | } 67 | return false 68 | } 69 | 70 | func showDialog(message: String, info: String) { 71 | let alert: NSAlert = NSAlert() 72 | alert.messageText = message 73 | alert.informativeText = info 74 | alert.alertStyle = NSAlert.Style.critical 75 | alert.addButton(withTitle: "OK") 76 | alert.beginSheetModal(for: view.window!, completionHandler: nil) 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Home Assistant/PrefrencesManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PrefrencesManager.swift 3 | // Home Assistant 4 | // 5 | // Created by Reza Moallemi on 9/16/17. 6 | // Copyright © 2017 Reza Moallemi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class PreferenceManager { 12 | // Single instance 13 | static let sharedInstance = PreferenceManager() 14 | 15 | fileprivate init() { 16 | registerFactoryDefaults() 17 | } 18 | 19 | let userDefaults = UserDefaults.standard 20 | 21 | fileprivate let defaultAddressIndexKey = "Default Address Index" 22 | fileprivate let defaultAddressKey = "Default Address" 23 | fileprivate let localAddressKey = "Local Address" 24 | fileprivate let globalAddressKey = "Global Address" 25 | 26 | var defaultAddressIndex: Int { 27 | get { 28 | return userDefaults.integer(forKey: defaultAddressIndexKey) 29 | } 30 | 31 | set { 32 | userDefaults.set(newValue, forKey: defaultAddressIndexKey) 33 | 34 | if newValue == 0 && localAddress != "" { 35 | userDefaults.set(localAddress, forKey: defaultAddressKey) 36 | } else if newValue == 1 && globalAddress != "" { 37 | userDefaults.set(globalAddress, forKey: defaultAddressKey) 38 | } else { 39 | userDefaults.set("https://home-assistant.io/demo/", forKey: defaultAddressKey) 40 | } 41 | } 42 | } 43 | 44 | public private(set) var defaultAddress: String { 45 | get { 46 | return userDefaults.string(forKey: defaultAddressKey)! 47 | } 48 | 49 | set { 50 | userDefaults.set(newValue, forKey: defaultAddressKey) 51 | } 52 | } 53 | 54 | var localAddress: String { 55 | get { 56 | return userDefaults.string(forKey: localAddressKey)! 57 | } 58 | 59 | set { 60 | userDefaults.set(newValue, forKey: localAddressKey) 61 | } 62 | } 63 | 64 | var globalAddress: String { 65 | get { 66 | return userDefaults.string(forKey: globalAddressKey)! 67 | } 68 | 69 | set { 70 | userDefaults.set(newValue, forKey: globalAddressKey) 71 | } 72 | } 73 | 74 | fileprivate func registerFactoryDefaults() { 75 | let factoryDefaults = [ 76 | defaultAddressIndexKey: NSNumber(value: 1), // index 1 = Global 77 | localAddressKey: NSString(), 78 | defaultAddressKey: "https://home-assistant.io/demo/", 79 | globalAddressKey: "https://home-assistant.io/demo/" 80 | ] as [String : Any] 81 | 82 | userDefaults.register(defaults: factoryDefaults) 83 | } 84 | 85 | func synchronize() { 86 | userDefaults.synchronize() 87 | } 88 | 89 | func reset() { 90 | userDefaults.removeObject(forKey: defaultAddressKey) 91 | userDefaults.removeObject(forKey: defaultAddressIndexKey) 92 | userDefaults.removeObject(forKey: localAddressKey) 93 | userDefaults.removeObject(forKey: globalAddressKey) 94 | 95 | synchronize() 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Home Assistant.xcodeproj/xcuserdata/reza.xcuserdatad/xcschemes/Home Assistant.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Home Assistant.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F509ED681F6D28B50014E102 /* PrefrencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F509ED671F6D28B50014E102 /* PrefrencesWindowController.swift */; }; 11 | F509ED6B1F6D2F070014E102 /* PrefrencesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F509ED6A1F6D2F070014E102 /* PrefrencesManager.swift */; }; 12 | F56B3D3E1F6E4124005E491C /* PrefrencesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F56B3D3D1F6E4124005E491C /* PrefrencesViewController.swift */; }; 13 | F5E41BF91F6E926E00B54880 /* BrwoserWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5E41BF81F6E926E00B54880 /* BrwoserWindowController.swift */; }; 14 | F5F718E41F6AB55300A40C98 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5F718E31F6AB55300A40C98 /* AppDelegate.swift */; }; 15 | F5F718E61F6AB55300A40C98 /* BrowserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5F718E51F6AB55300A40C98 /* BrowserViewController.swift */; }; 16 | F5F718E81F6AB55300A40C98 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F5F718E71F6AB55300A40C98 /* Assets.xcassets */; }; 17 | F5F718EB1F6AB55300A40C98 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F5F718E91F6AB55300A40C98 /* Main.storyboard */; }; 18 | F5FF2D3C1F76B937009D41AE /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5FF2D3B1F76B937009D41AE /* Utils.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | F509ED671F6D28B50014E102 /* PrefrencesWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PrefrencesWindowController.swift; sourceTree = ""; }; 23 | F509ED6A1F6D2F070014E102 /* PrefrencesManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PrefrencesManager.swift; sourceTree = ""; }; 24 | F56B3D3D1F6E4124005E491C /* PrefrencesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PrefrencesViewController.swift; sourceTree = ""; }; 25 | F5E41BF81F6E926E00B54880 /* BrwoserWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BrwoserWindowController.swift; sourceTree = ""; }; 26 | F5F718E01F6AB55300A40C98 /* Home Assistant.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Home Assistant.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | F5F718E31F6AB55300A40C98 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 28 | F5F718E51F6AB55300A40C98 /* BrowserViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowserViewController.swift; sourceTree = ""; }; 29 | F5F718E71F6AB55300A40C98 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 30 | F5F718EA1F6AB55300A40C98 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 31 | F5F718EC1F6AB55300A40C98 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | F5FF2D3B1F76B937009D41AE /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | F5F718DD1F6AB55300A40C98 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | F509ED691F6D290D0014E102 /* Prefrences */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | F509ED6A1F6D2F070014E102 /* PrefrencesManager.swift */, 50 | F509ED671F6D28B50014E102 /* PrefrencesWindowController.swift */, 51 | F56B3D3D1F6E4124005E491C /* PrefrencesViewController.swift */, 52 | ); 53 | name = Prefrences; 54 | sourceTree = ""; 55 | }; 56 | F5E41BF71F6E91F400B54880 /* Browser */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | F5F718E51F6AB55300A40C98 /* BrowserViewController.swift */, 60 | F5E41BF81F6E926E00B54880 /* BrwoserWindowController.swift */, 61 | ); 62 | name = Browser; 63 | sourceTree = ""; 64 | }; 65 | F5F718D71F6AB55300A40C98 = { 66 | isa = PBXGroup; 67 | children = ( 68 | F5F718E21F6AB55300A40C98 /* Home Assistant */, 69 | F5F718E11F6AB55300A40C98 /* Products */, 70 | ); 71 | sourceTree = ""; 72 | }; 73 | F5F718E11F6AB55300A40C98 /* Products */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | F5F718E01F6AB55300A40C98 /* Home Assistant.app */, 77 | ); 78 | name = Products; 79 | sourceTree = ""; 80 | }; 81 | F5F718E21F6AB55300A40C98 /* Home Assistant */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | F5E41BF71F6E91F400B54880 /* Browser */, 85 | F509ED691F6D290D0014E102 /* Prefrences */, 86 | F5F718E31F6AB55300A40C98 /* AppDelegate.swift */, 87 | F5FF2D3B1F76B937009D41AE /* Utils.swift */, 88 | F5F718E71F6AB55300A40C98 /* Assets.xcassets */, 89 | F5F718E91F6AB55300A40C98 /* Main.storyboard */, 90 | F5F718EC1F6AB55300A40C98 /* Info.plist */, 91 | ); 92 | path = "Home Assistant"; 93 | sourceTree = ""; 94 | }; 95 | /* End PBXGroup section */ 96 | 97 | /* Begin PBXNativeTarget section */ 98 | F5F718DF1F6AB55300A40C98 /* Home Assistant */ = { 99 | isa = PBXNativeTarget; 100 | buildConfigurationList = F5F718EF1F6AB55300A40C98 /* Build configuration list for PBXNativeTarget "Home Assistant" */; 101 | buildPhases = ( 102 | F5F718DC1F6AB55300A40C98 /* Sources */, 103 | F5F718DD1F6AB55300A40C98 /* Frameworks */, 104 | F5F718DE1F6AB55300A40C98 /* Resources */, 105 | ); 106 | buildRules = ( 107 | ); 108 | dependencies = ( 109 | ); 110 | name = "Home Assistant"; 111 | productName = "Home Assistant"; 112 | productReference = F5F718E01F6AB55300A40C98 /* Home Assistant.app */; 113 | productType = "com.apple.product-type.application"; 114 | }; 115 | /* End PBXNativeTarget section */ 116 | 117 | /* Begin PBXProject section */ 118 | F5F718D81F6AB55300A40C98 /* Project object */ = { 119 | isa = PBXProject; 120 | attributes = { 121 | LastSwiftUpdateCheck = 0830; 122 | LastUpgradeCheck = 0830; 123 | ORGANIZATIONNAME = "Reza Moallemi"; 124 | TargetAttributes = { 125 | F5F718DF1F6AB55300A40C98 = { 126 | CreatedOnToolsVersion = 8.3.3; 127 | LastSwiftMigration = 0900; 128 | ProvisioningStyle = Automatic; 129 | }; 130 | }; 131 | }; 132 | buildConfigurationList = F5F718DB1F6AB55300A40C98 /* Build configuration list for PBXProject "Home Assistant" */; 133 | compatibilityVersion = "Xcode 3.2"; 134 | developmentRegion = English; 135 | hasScannedForEncodings = 0; 136 | knownRegions = ( 137 | en, 138 | Base, 139 | ); 140 | mainGroup = F5F718D71F6AB55300A40C98; 141 | productRefGroup = F5F718E11F6AB55300A40C98 /* Products */; 142 | projectDirPath = ""; 143 | projectRoot = ""; 144 | targets = ( 145 | F5F718DF1F6AB55300A40C98 /* Home Assistant */, 146 | ); 147 | }; 148 | /* End PBXProject section */ 149 | 150 | /* Begin PBXResourcesBuildPhase section */ 151 | F5F718DE1F6AB55300A40C98 /* Resources */ = { 152 | isa = PBXResourcesBuildPhase; 153 | buildActionMask = 2147483647; 154 | files = ( 155 | F5F718E81F6AB55300A40C98 /* Assets.xcassets in Resources */, 156 | F5F718EB1F6AB55300A40C98 /* Main.storyboard in Resources */, 157 | ); 158 | runOnlyForDeploymentPostprocessing = 0; 159 | }; 160 | /* End PBXResourcesBuildPhase section */ 161 | 162 | /* Begin PBXSourcesBuildPhase section */ 163 | F5F718DC1F6AB55300A40C98 /* Sources */ = { 164 | isa = PBXSourcesBuildPhase; 165 | buildActionMask = 2147483647; 166 | files = ( 167 | F5F718E61F6AB55300A40C98 /* BrowserViewController.swift in Sources */, 168 | F5F718E41F6AB55300A40C98 /* AppDelegate.swift in Sources */, 169 | F509ED6B1F6D2F070014E102 /* PrefrencesManager.swift in Sources */, 170 | F5FF2D3C1F76B937009D41AE /* Utils.swift in Sources */, 171 | F56B3D3E1F6E4124005E491C /* PrefrencesViewController.swift in Sources */, 172 | F5E41BF91F6E926E00B54880 /* BrwoserWindowController.swift in Sources */, 173 | F509ED681F6D28B50014E102 /* PrefrencesWindowController.swift in Sources */, 174 | ); 175 | runOnlyForDeploymentPostprocessing = 0; 176 | }; 177 | /* End PBXSourcesBuildPhase section */ 178 | 179 | /* Begin PBXVariantGroup section */ 180 | F5F718E91F6AB55300A40C98 /* Main.storyboard */ = { 181 | isa = PBXVariantGroup; 182 | children = ( 183 | F5F718EA1F6AB55300A40C98 /* Base */, 184 | ); 185 | name = Main.storyboard; 186 | sourceTree = ""; 187 | }; 188 | /* End PBXVariantGroup section */ 189 | 190 | /* Begin XCBuildConfiguration section */ 191 | F5F718ED1F6AB55300A40C98 /* Debug */ = { 192 | isa = XCBuildConfiguration; 193 | buildSettings = { 194 | ALWAYS_SEARCH_USER_PATHS = NO; 195 | CLANG_ANALYZER_NONNULL = YES; 196 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 197 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 198 | CLANG_CXX_LIBRARY = "libc++"; 199 | CLANG_ENABLE_MODULES = YES; 200 | CLANG_ENABLE_OBJC_ARC = YES; 201 | CLANG_WARN_BOOL_CONVERSION = YES; 202 | CLANG_WARN_CONSTANT_CONVERSION = YES; 203 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 204 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 205 | CLANG_WARN_EMPTY_BODY = YES; 206 | CLANG_WARN_ENUM_CONVERSION = YES; 207 | CLANG_WARN_INFINITE_RECURSION = YES; 208 | CLANG_WARN_INT_CONVERSION = YES; 209 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 210 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 211 | CLANG_WARN_UNREACHABLE_CODE = YES; 212 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 213 | CODE_SIGN_IDENTITY = "-"; 214 | COPY_PHASE_STRIP = NO; 215 | DEBUG_INFORMATION_FORMAT = dwarf; 216 | ENABLE_STRICT_OBJC_MSGSEND = YES; 217 | ENABLE_TESTABILITY = YES; 218 | GCC_C_LANGUAGE_STANDARD = gnu99; 219 | GCC_DYNAMIC_NO_PIC = NO; 220 | GCC_NO_COMMON_BLOCKS = YES; 221 | GCC_OPTIMIZATION_LEVEL = 0; 222 | GCC_PREPROCESSOR_DEFINITIONS = ( 223 | "DEBUG=1", 224 | "$(inherited)", 225 | ); 226 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 227 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 228 | GCC_WARN_UNDECLARED_SELECTOR = YES; 229 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 230 | GCC_WARN_UNUSED_FUNCTION = YES; 231 | GCC_WARN_UNUSED_VARIABLE = YES; 232 | MACOSX_DEPLOYMENT_TARGET = 10.12; 233 | MTL_ENABLE_DEBUG_INFO = YES; 234 | ONLY_ACTIVE_ARCH = YES; 235 | SDKROOT = macosx; 236 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 237 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 238 | }; 239 | name = Debug; 240 | }; 241 | F5F718EE1F6AB55300A40C98 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | ALWAYS_SEARCH_USER_PATHS = NO; 245 | CLANG_ANALYZER_NONNULL = YES; 246 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 247 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 248 | CLANG_CXX_LIBRARY = "libc++"; 249 | CLANG_ENABLE_MODULES = YES; 250 | CLANG_ENABLE_OBJC_ARC = YES; 251 | CLANG_WARN_BOOL_CONVERSION = YES; 252 | CLANG_WARN_CONSTANT_CONVERSION = YES; 253 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 254 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 255 | CLANG_WARN_EMPTY_BODY = YES; 256 | CLANG_WARN_ENUM_CONVERSION = YES; 257 | CLANG_WARN_INFINITE_RECURSION = YES; 258 | CLANG_WARN_INT_CONVERSION = YES; 259 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 260 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 261 | CLANG_WARN_UNREACHABLE_CODE = YES; 262 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 263 | CODE_SIGN_IDENTITY = "-"; 264 | COPY_PHASE_STRIP = NO; 265 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 266 | ENABLE_NS_ASSERTIONS = NO; 267 | ENABLE_STRICT_OBJC_MSGSEND = YES; 268 | GCC_C_LANGUAGE_STANDARD = gnu99; 269 | GCC_NO_COMMON_BLOCKS = YES; 270 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 271 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 272 | GCC_WARN_UNDECLARED_SELECTOR = YES; 273 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 274 | GCC_WARN_UNUSED_FUNCTION = YES; 275 | GCC_WARN_UNUSED_VARIABLE = YES; 276 | MACOSX_DEPLOYMENT_TARGET = 10.12; 277 | MTL_ENABLE_DEBUG_INFO = NO; 278 | SDKROOT = macosx; 279 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 280 | }; 281 | name = Release; 282 | }; 283 | F5F718F01F6AB55300A40C98 /* Debug */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 287 | COMBINE_HIDPI_IMAGES = YES; 288 | INFOPLIST_FILE = "Home Assistant/Info.plist"; 289 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 290 | PRODUCT_BUNDLE_IDENTIFIER = "me.moallemi.Home-Assistant"; 291 | PRODUCT_NAME = "$(TARGET_NAME)"; 292 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 293 | SWIFT_VERSION = 4.0; 294 | }; 295 | name = Debug; 296 | }; 297 | F5F718F11F6AB55300A40C98 /* Release */ = { 298 | isa = XCBuildConfiguration; 299 | buildSettings = { 300 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 301 | COMBINE_HIDPI_IMAGES = YES; 302 | INFOPLIST_FILE = "Home Assistant/Info.plist"; 303 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 304 | PRODUCT_BUNDLE_IDENTIFIER = "me.moallemi.Home-Assistant"; 305 | PRODUCT_NAME = "$(TARGET_NAME)"; 306 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 307 | SWIFT_VERSION = 4.0; 308 | }; 309 | name = Release; 310 | }; 311 | /* End XCBuildConfiguration section */ 312 | 313 | /* Begin XCConfigurationList section */ 314 | F5F718DB1F6AB55300A40C98 /* Build configuration list for PBXProject "Home Assistant" */ = { 315 | isa = XCConfigurationList; 316 | buildConfigurations = ( 317 | F5F718ED1F6AB55300A40C98 /* Debug */, 318 | F5F718EE1F6AB55300A40C98 /* Release */, 319 | ); 320 | defaultConfigurationIsVisible = 0; 321 | defaultConfigurationName = Release; 322 | }; 323 | F5F718EF1F6AB55300A40C98 /* Build configuration list for PBXNativeTarget "Home Assistant" */ = { 324 | isa = XCConfigurationList; 325 | buildConfigurations = ( 326 | F5F718F01F6AB55300A40C98 /* Debug */, 327 | F5F718F11F6AB55300A40C98 /* Release */, 328 | ); 329 | defaultConfigurationIsVisible = 0; 330 | defaultConfigurationName = Release; 331 | }; 332 | /* End XCConfigurationList section */ 333 | }; 334 | rootObject = F5F718D81F6AB55300A40C98 /* Project object */; 335 | } 336 | -------------------------------------------------------------------------------- /Home Assistant/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | Local 417 | Global 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | --------------------------------------------------------------------------------