Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
self.name = name
self._vendor = vendor
self.serial = serial
self.secret = secret
self.traits = traits
self.has_persistent_maps = has_persistent_maps
self._url = '{endpoint}/vendors/{vendor_name}/robots/{serial}/messages'.format(
endpoint=re.sub(':\d+', '', endpoint), # Remove port number
vendor_name=vendor.name,
serial=self.serial)
self._headers = {'Accept': 'application/vnd.neato.nucleo.v1'}
if self.service_version not in SUPPORTED_SERVICES:
raise NeatoUnsupportedDevice("Version " + self.service_version + " of service houseCleaning is not known")