import uuid
import json


def _create_uuid(filename):
    """Create a uuid for the device."""
    with open(filename, "w") as fptr:
        new_uuid = uuid.uuid4()
        fptr.write(json.dumps({"nexia_uuid": str(new_uuid)}))
        return new_uuid