@property
    def state_attributes(self):
        if self.state == STATE_OFF:
            state_attr = {
                ATTR_SUPPORTED_MEDIA_COMMANDS: self.supported_media_commands,
            }
        else:
            state_attr = {
                attr: getattr(self, attr) for attr
                in ATTR_TO_PROPERTY if getattr(self, attr) is not None
            }

        return state_attr
Return the state attributes.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/media_player/__init__.py/MediaPlayerDevice.state_attributes