@classmethod
def create(cls, *args, **kwargs):
    """Create factory method for instantiating devices. Takes the source JSON object
        and figures out which type of class it should make and then calls the constructor.
        """
    allowed_devices = ['Controller', 'RoomStat', 'iTRV']
    classname = kwargs['ProductType']
    if classname not in allowed_devices:
        raise Exception('Invalid Device')
    cls = globals()[classname]
    return cls(*args, **kwargs)
