- def read_persisted_macs_file(self, filename: str, location: Location) -> None:
- if location is Location.UNKNOWN:
- return
- with open(filename, "r") as rf:
- lines = rf.read()
- self.parse_raw_macs_file(lines, location)
+ def _update_cabin(self) -> None:
+ data = self._get_raw_data(Location.CABIN)
+ if data:
+ self._parse_raw_macs_file(data, Location.CABIN)
+ else:
+ msg = "Can't see the cabin right now; presence detection impared."
+ warnings.warn(msg)
+ logger.warning(msg, stacklevel=2)
+ self.dark_locations.add(Location.CABIN)
+
+ def _parse_raw_macs_file(self, raw: str, location: Location) -> None:
+ """Internal method that parses the contents of the MACs file."""