Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def device_info(self):
return DeviceInfo(self)
def power_source_str(self):
"""String representation of current power source."""
if DeviceInfo.ATTR_POWER_SOURCE not in self.raw:
return None
return DeviceInfo.VALUE_POWER_SOURCES.get(self.power_source, 'Unknown')
def serial(self):
"""Serial number string."""
return self.raw.get(DeviceInfo.ATTR_SERIAL)
def battery_level(self):
"""Battery in 0..100"""
return self.raw.get(DeviceInfo.ATTR_BATTERY)
def power_source(self):
"""Power source."""
return self.raw.get(DeviceInfo.ATTR_POWER_SOURCE)
def manufacturer(self):
"""Human readable manufacturer name."""
return self.raw.get(DeviceInfo.ATTR_MANUFACTURER)
def model_number(self):
"""A model identifier string (manufactuer specified string)."""
return self.raw.get(DeviceInfo.ATTR_MODEL_NUMBER)
def firmware_version(self):
"""Current firmware version string of the device."""
return self.raw.get(DeviceInfo.ATTR_FIRMWARE_VERSION)