<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def device_state_attributes(self):
 """Return the state attributes of the device."""

        attr = {}
        attr['active_time'] = self.smartplug.active_time
        attr['voltage'] = self.smartplug.voltage
        attr['active_time'] = self.smartplug.active_time
        attr['weekly_energy_total'] = self.smartplug.weekly_energy_total
        attr['monthly_energy_total'] = self.smartplug.monthly_energy_total
        attr['yearly_energy_total'] = self.smartplug.yearly_energy_total
        return attr