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
| blueprint: | |
| name: Motion-Aware Light Control | |
| description: > | |
| Turns lights on when motion is detected and off again after a period of inactivity. | |
| **What makes this blueprint different:** | |
| It continuously re-evaluates activation and blocking conditions — not only when motion is first detected. | |
| Examples: |
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
| import plistlib | |
| import CoreFoundation | |
| from Foundation import NSDate, NSMutableArray, NSMutableDictionary | |
| # read the current ManagedPlugInPolicies | |
| policy = CoreFoundation.CFPreferencesCopyAppValue("ManagedPlugInPolicies", "com.apple.Safari") | |
| if policy: | |
| # policy is an immutable dict, so we have to make a mutable copy | |
| my_policy = NSMutableDictionary.alloc().initWithDictionary_copyItems_(policy, True) |
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
| #!/bin/bash | |
| rm -rf *.o *.[568] test_* |