# Note: this module is fairly early loaded. Be aware of dependencies.
import config
-from locations import Location
+from type.locations import Location
logger = logging.getLogger(__name__)
args = config.add_commandline_args(
- f'({__file__})',
- 'Args related to __file__'
+ f'Global Site Config ({__file__})',
+ 'Args related to global site-specific configuration'
)
args.add_argument(
'--site_config_override_location',
default='NONE',
const='NONE',
nargs='?',
- choices=('HOUSE', 'CABIN', 'NONE'),
- help='Where are we, HOUSE, CABIN?',
+ choices=['HOUSE', 'CABIN', 'NONE'],
+ help='Where are we, HOUSE, CABIN? Overrides standard detection code.',
)
network_netmask: str
network_router_ip: str
presence_location: Location
- is_anyone_present: Callable[None, bool]
+ is_anyone_present: Callable
arper_minimum_device_count: int
"""
Returns location as an enum instead of a string.
- >>> from locations import Location
+ >>> from type.locations import Location
>>> location = get_location()
>>> location == Location.HOUSE or location == Location.CABIN
True
def is_anyone_present_wrapper(location: Location):
- import presence
- p = presence.PresenceDetection()
+ import base_presence
+ p = base_presence.PresenceDetection()
return p.is_anyone_in_location_now(location)