'Test set night mode service.'

def test_service_set_night_mode(self):

    dyson_device = mock.MagicMock()
    self.hass.data[DYSON_DEVICES] = []
    dyson_device.entity_id = 'fan.living_room'
    self.hass.data[dyson.DYSON_FAN_DEVICES] = [dyson_device]
    dyson.setup_platform(self.hass, None, mock.MagicMock())
    self.hass.services.call(dyson.DOMAIN, dyson.SERVICE_SET_NIGHT_MODE, {'entity_id': 'fan.bed_room', 'night_mode': True}, True)
    assert (not dyson_device.night_mode.called)
    self.hass.services.call(dyson.DOMAIN, dyson.SERVICE_SET_NIGHT_MODE, {'entity_id': 'fan.living_room', 'night_mode': True}, True)
    dyson_device.night_mode.assert_called_with(True)
