'Return the state attributes of the device.'

@property
def device_state_attributes(self):

    attr = {}
    if self.maker_params:
        if self.maker_params['hassensor']:
            if self.maker_params['sensorstate']:
                attr[ATTR_SENSOR_STATE] = STATE_OFF
            else:
                attr[ATTR_SENSOR_STATE] = STATE_ON
        if self.maker_params['switchmode']:
            attr[ATTR_SWITCH_MODE] = MAKER_SWITCH_MOMENTARY
        else:
            attr[ATTR_SWITCH_MODE] = MAKER_SWITCH_TOGGLE
    if (self.insight_params or (self.coffeemaker_mode is not None)):
        attr[ATTR_CURRENT_STATE_DETAIL] = self.detail_state
    if self.insight_params:
        attr['on_latest_time'] = WemoSwitch.as_uptime(self.insight_params['onfor'])
        attr['on_today_time'] = WemoSwitch.as_uptime(self.insight_params['ontoday'])
        attr['on_total_time'] = WemoSwitch.as_uptime(self.insight_params['ontotal'])
        attr['power_threshold_w'] = (convert(self.insight_params['powerthreshold'], float, 0.0) / 1000.0)
    if (self.coffeemaker_mode is not None):
        attr[ATTR_COFFEMAKER_MODE] = self.coffeemaker_mode
    return attr
