Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return {}
state_dict = {}
for field in state.split(';'):
split = field.split(':')
if len(split) < 2:
continue
key = split[0]
value = split[1]
if key in Tello.state_field_converters:
try:
value = Tello.state_field_converters[key](value)
except Exception as e:
Tello.LOGGER.debug('Error parsing state value for {}: {} to {}'
.format(key, value, Tello.state_field_converters[key]))
Tello.LOGGER.error(e)
state_dict[key] = value
return state_dict
state_dict = {}
for field in state.split(';'):
split = field.split(':')
if len(split) < 2:
continue
key = split[0]
value = split[1]
if key in Tello.state_field_converters:
try:
value = Tello.state_field_converters[key](value)
except Exception as e:
Tello.LOGGER.debug('Error parsing state value for {}: {} to {}'
.format(key, value, Tello.state_field_converters[key]))
Tello.LOGGER.error(e)
state_dict[key] = value
return state_dict