'Initialize the xiaomi device.'

def __init__(self, device, name, xiaomi_hub):

    self._state = None
    self._sid = device['sid']
    self._name = '{}_{}'.format(name, self._sid)
    self._write_to_hub = xiaomi_hub.write_to_hub
    self._get_from_hub = xiaomi_hub.get_from_hub
    xiaomi_hub.callbacks[self._sid].append(self.push_data)
    self._device_state_attributes = {}
    self.parse_data(device['data'])
    self.parse_voltage(device['data'])
