def resets_json(fn):
    """
    Decorator that resets cached device info json
    Usage:
    @resets_json
    def modify_device(self):
        pass
    """
    the_fn = fn

    def wrapper(self, *args, **kwargs):
        try:
            r = the_fn(self, *args, **kwargs)
        except:
            raise
        finally:
            self._json = None

        return r

    return wrapper